Stačí použít GROUP BY
místo DISTINCT
. Zkuste tedy tento dotaz:
SELECT personid, COUNT(msg)
FROM mytable
GROUP BY personid
ORDER BY personid;
Stačí použít GROUP BY
místo DISTINCT
. Zkuste tedy tento dotaz:
SELECT personid, COUNT(msg)
FROM mytable
GROUP BY personid
ORDER BY personid;