0

我想order by views desc然后id desc 我试过了

ORDER BY `id` DESC , `views` DESC 

ORDER BY `views ` DESC , `id` DESC 

它没有给我我需要的结果

我想通过视图获取最新消息

table news
id int(11)|views int(11)

请有任何帮助

4

3 回答 3

1

然后将变量以正确的顺序放入子句中:

ORDER BY `views` DESC, `id` DESC 
于 2013-08-04T12:59:44.587 回答
1

然后先使用订单视图,然后再使用 id。

尝试这个

   ORDER BY  `views` DESC ,`id` DESC 
于 2013-08-04T12:59:56.383 回答
1

我认为语法通常是 ORDER BY id,views DESC

于 2013-08-04T13:00:46.380 回答