标签: php sql
我正在尝试显示所有记录,其中field_featured = 1从我的列表顶部开始...以及所有其他记录显示在RAND()
因此...
SELECT * FROM myTable
if(field_featured = 1则ORDER BY field_featured)OTHERWISE(ORDER BY RAND())
我该怎么做?
答案 0 :(得分:4)
试试这个:
ORDER BY (field_fieatured=1) DESC, RAND()