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.
我正在尝试显示 field_featured = 1 的所有记录,从我的列表顶部开始......所有其他记录都显示在 RAND()
所以...
SELECT * FROM myTable
如果 (field_featured = 1 则 ORDER BY field_featured) OTHERWISE (ORDER BY RAND() )
我怎样才能做到这一点?
试试这个:
ORDER BY (field_fieatured=1) DESC, RAND()