lundi 6 avril 2015

MYSQL order by a column from another table row count


Vote count:

0




I have 2 table : code and code_like


code table



id | code_name
---------------
1 | pagination
2 | function
3 | script


colde_like table



id | code_id(id of code table)
1 | 3
2 | 1
3 | 3
4 | 2
5 | 1
6 | 3


I want to sort code table by row count of code_like table


Example :



I want result like
(1) script (1st because 3 times in code_like talbe)
(2) pagination (2nd because 2 times in code_like talbe)
(3) function (3rd because 1 time in code_like talbe)


asked 1 min ago







MYSQL order by a column from another table row count

Aucun commentaire:

Enregistrer un commentaire