Mysql
 sql >> Base de Dados >  >> RDS >> Mysql

ordem mysql por max corresponde ao valor do campo


Tente isto:
SELECT DISTINCT(l.name) AS link 
FROM links l INNER JOIN tags t ON l.id = t.link_id 
AND l.id <> 1 GROUP BY t.link_id ORDER BY COUNT(t.link_id) DESC

SQLFIDDLE DEMO