Order表的数据结构
Id 自增长序号 bigint
OrderNumber 订单编号 varchar
OrderPrice 订单价格 money
Crafts 工艺 varchar
IsBite 是否留咬口 bit
IsUrgent 是否加急 bit
....省略其它字段
Crafts工艺,IsBite 留咬口, IsUrgent 加急 这3个字段需要参与排序
它们的优先级是IsUrgent = true > IsBite= true > Crafts !='' ,有加急的最优先,其次是留咬口的优先,最后是有工艺的优先
请大神赐教这个SQL应该怎么写.

------解决方案--------------------
LZV5------解决方案--------------------
第一 尝试下构造函数
select *,unicode(isUrgent+IsBite)+case when isnull(unicode(Crafts),0)>0 then 1 else 0 end as orderPrority from production
order by orderPrority
------解决方案--------------------
select *,isUrgent+IsBite+case when isnull(unicode(Crafts),0)>0 then 1 else 0 end as orderPrority
from productionOrder
order by orderPrority
------解决方案--------------------
要不把你order by 的三个字段建一个联合索引试试
------解决方案--------------------
用8楼的方法 试试。
------解决方案--------------------