SQL
mysql
sql排序
php
------解决方案--------------------
select * from company where city like '%北京%' and top like '北京' order by id desc union select * from company where city like '%北京%' and top not like '北京' order by id desc
------解决方案--------------------<br />
select * from company where city like '%北京%' and top like '北京' order by id desc union select * from company where city like '%北京%' and top not like '北京' order by id desc <br />
------解决方案--------------------试试这个,测试可以
SELECT *<br />
FROM test<br />
WHERE city LIKE '%北京%'<br />
ORDER BY (<br />
top LIKE '%北京%'<br />
) DESC , id DESC<br />