orderid billmode currentOrderStatus
----------- -------------------------------------------------- ------------------
390 货到付款 2
391 银行转账 6
392 货到付款 2
393 财付通 2
394 货到付款 2
395 上门自提 2select * from cv_order if(billmode<>'货到付款') then currentOrderStatus=3这个语句是错的,
我想实现的的结果是,查询所有的内容,但是如果billmode<>'货到付款'的话,要满足条件currentOrderStatus=3,哪位帮忙解决一下
----------- -------------------------------------------------- ------------------
390 货到付款 2
391 银行转账 6
392 货到付款 2
393 财付通 2
394 货到付款 2
395 上门自提 2select * from cv_order if(billmode<>'货到付款') then currentOrderStatus=3这个语句是错的,
我想实现的的结果是,查询所有的内容,但是如果billmode<>'货到付款'的话,要满足条件currentOrderStatus=3,哪位帮忙解决一下
WHERE currentOrderStatus= CASE WHEN billmode<>'货到付款' then 3 ELSE currentOrderStatus END
from cv_order
where
currentOrderStatus=(case when billmode<>'货到付款' then 3 else currentOrderStatus end)
then 3 else currentOrderStatus End )
WHERE ( billmode<>'货到付款' AND currentOrderStatus =3 )
OR (billmode='货到付款' AND currentOrderStatus =currentOrderStatus )