我有2个表:代码和code_likeMYSQL顺序计数
码表
code_id | code_name
---------------
1 | pagination
2 | function
3 | script
code_like表
like_id | code_id(id of code table)
1 | 3
2 | 1
3 | 3
4 | 2
5 | 1
6 | 3
我想按行排序code table
计数code_like
表
例如:
I want result like
(1) script (1st because 3 times in code_like table)
(2) pagination (2nd because 2 times in code_like table)
(3) function (3rd because 1 time in code_like table)
两个表的主键不具有相同的名称。在code_like表中将id更改为c_id。 – user3386779