日期:2014-05-18  浏览次数:20502 次

如何将符合第一个条件的数据向前排
如select * from a1 where a1.title1 like '第一' or a1.title2 like '第二' order by id desc 我想将符合第一个条件(a1.title1 like '第一' )的数据全都放在第二个条件的数据前面

------解决方案--------------------
如select * from a1 where a1.title1 like '第一 ' or a1.title2 like '第二 ' order by id desc 我想将符合第一个条件(a1.title1 like '第一 ' )的数据全都放在第二个条件的数据前面
--------------------------------------------------

select * from a1 where a1.title1 like '第一'
union all
select * from a1 where a1.title2 like '第二'