隨記: MySQL 中抓「出現一次」的個數

o MySQL 中抓「出現一次」的個數:

SELECT COUNT(DISTINCT `UsrIp`) FROM mytab;

比較:
SELECT COUNT(DISTINCT `UsrIp`) FROM mytab GROUP BY `UsrIp`;

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.