瓜西西

导航

在 order by 中 使用 iif

select s.*,st.name as type_name from storage s,storage_type st,storage_item si where 1=1 and s.type_id=st.id and s.id=si.storage_id and si.order_by=1 and s.id>0

ORDER BY s.date desc,iif(s.status=0,0,1),s.id desc

posted on 2012-03-22 09:42  瓜西西  阅读(349)  评论(0编辑  收藏  举报