0
我有一个问题,我不知道如何解决它...排序MYSQL有两个参数
我有一个表“的产品”,它有2列“伟大”(BOOL:0 - 1)和“秩序”(编号:0 - N)...我需要与后续的规则排序的所有记录:
1.- First, all with "great" in 1 and all with "order" > 0.
2.- All with "great" and "order" = 0
3.- All with "great" = 0 and "order" > 0.
4.- All with "great" = 0 and "order" = 0.
我需要在一个SQL,所以我不知道是否有可能。我尝试过:
ORDER BY great DESC, order DESC
...所以先用1和后面的数字顺序很好,但有时以4和0顺序排列,它几乎在第一个语句。
谢谢!