Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个包含图像列表的表格,并希望将它们排序为流行的图像序列。下面列出了表格,我想制作“目标列”,以便我对流行图像进行排序。
这是SQL代码:
SELECT imageID FROM `ratings` WHERE rating > 3 ORDER BY imageID DESC
谢谢你的帮助。
试试这个,使用计数和分组依据,这将计算重复的 ImageID:
SELECT count(*) as ct, imageID FROM `ratings` WHERE rating > 3 GROUP BY imageID ORDER BY ct