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

sql精确查询
表Product,有字段Status 值为0,或1,有字段Time
现要查出所有数据,并且Status=1的数据优先显示,而且要按照Time排序,各位高手, 帮帮忙啦,纠结的很啊

------解决方案--------------------
select *
from tb
order by Status desc ,Time
--?
------解决方案--------------------
SQL code
select * from product order by status desc,[time]

------解决方案--------------------
SQL code
select * from Product order by Status desc, Time