Count number of distinct occurrences

select column_name, count(*) from table_name group by column_name order by count(*) desc;

Comments

Popular posts from this blog

Useful aliases

Enable Search Engine Friendly (Pretty URLs) in Yii2