COUNT()
を使用 MakeDistinct
をグループ化して機能 GROUP BY
を使用した列
SELECT MakeDistinct AS AfterDistinct
, COUNT(MakeDistinct) AS Count
FROM MyTable
GROUP BY MakeDistinct
出力:
╔═══════════════╦═══════╗
║ AFTERDISTINCT ║ COUNT ║
╠═══════════════╬═══════╣
║ CAT ║ 3 ║
║ DOG ║ 2 ║
║ PIN ║ 4 ║
╚═══════════════╩═══════╝