これは、JOIN
を含む単純なクエリです。 :
SELECT users.uid, users.uname, COUNT(logs.logid) AS logins
FROM users
LEFT JOIN logs ON logs.uid=users.uid
GROUP BY users.uid
ORDER BY logins DESC
これは、JOIN
を含む単純なクエリです。 :
SELECT users.uid, users.uname, COUNT(logs.logid) AS logins
FROM users
LEFT JOIN logs ON logs.uid=users.uid
GROUP BY users.uid
ORDER BY logins DESC