Order MySQL result by occurence of a field
SELECT `row`, COUNT(row) AS `count`, FROM `table` GROUP BY `row` ORDER BY `count`;
Sometimes it is necessary, to sort the rows of a MySQL select statement by the occurence of a field value.
SELECT `row`, COUNT(row) AS `count`, FROM `table` GROUP BY `row` ORDER BY `count`;
Sometimes it is necessary, to sort the rows of a MySQL select statement by the occurence of a field value.
Most popular snippets