Anda hanya perlu menggunakan GROUP BY
bukannya DISTINCT
. Jadi, coba kueri ini:
SELECT personid, COUNT(msg)
FROM mytable
GROUP BY personid
ORDER BY personid;
Anda hanya perlu menggunakan GROUP BY
bukannya DISTINCT
. Jadi, coba kueri ini:
SELECT personid, COUNT(msg)
FROM mytable
GROUP BY personid
ORDER BY personid;