日期:2014-05-17  浏览次数:20440 次

mysql条件 筛选表 符合条件的居前显示 不符合条件的在后面显示 居前和居后的都有自己的排序
筛选表 符合条件的居前显示 不符合条件的在后面显示  居前和居后的都有自己的排序

如;
/*************

得到未过期的数据行
select t.* from v_shop_data_type t  isFlag=1 order by publishTime

得到已过期的数据行
select t.* from v_shop_data_type t  isFlag=0 order by publishTime

************/

这两个查询如何合成一张表,未过期的在前面显示,已过期的在后面显示
有高手知道没,,,万分感谢

------解决方案--------------------
select t.* from v_shop_data_type t order by isFlag desc,publishTime
------解决方案--------------------
select t.* from v_shop_data_type t order by isFlag desc,publishTime

------解决方案--------------------
select t.* from v_shop_data_type t  isFlag=1
union all
select t.* from v_shop_data_type t  isFlag=0 
order by isFlag, publishTime