sql语句多字段多个值如何进行排序?需求是查询所有的列表,然后根据出发地和目的地进行排序,我是用case when 语法总是报错
sql语句如下
select swco.id,swco.order_type,swco.goods_type_id,swco.departure,swco.bounty,swco.goods_number,swco.goods_name,swco.destination,swco.goods_value,swco.goods_weight,swco.order_status,swco.end_time,swco.start_time
from sys_we_chat_order swco where swco.deleted =0 order by case when departure ='北京' and destination ='衡水' then '北京' when departure ='北京' then '衡水'
when destination ='衡水' then '衡水', swco.create_time desc
报错信息如下
我这么写有什么问题吗,或者其他方法如何实现