Brug COUNT()
funktion ved at gruppere MakeDistinct
kolonne ved hjælp af GROUP BY
klausul.
SELECT MakeDistinct AS AfterDistinct
, COUNT(MakeDistinct) AS Count
FROM MyTable
GROUP BY MakeDistinct
Output:
╔═══════════════╦═══════╗
║ AFTERDISTINCT ║ COUNT ║
╠═══════════════╬═══════╣
║ CAT ║ 3 ║
║ DOG ║ 2 ║
║ PIN ║ 4 ║
╚═══════════════╩═══════╝