Gunakan COUNT()
fungsi dengan mengelompokkan MakeDistinct
kolom menggunakan GROUP BY
klausa.
SELECT MakeDistinct AS AfterDistinct
, COUNT(MakeDistinct) AS Count
FROM MyTable
GROUP BY MakeDistinct
Keluaran:
╔═══════════════╦═══════╗
║ AFTERDISTINCT ║ COUNT ║
╠═══════════════╬═══════╣
║ CAT ║ 3 ║
║ DOG ║ 2 ║
║ PIN ║ 4 ║
╚═══════════════╩═══════╝