Oracle中在ordery中用case when

来源:互联网 发布:裁决之镰解除软件 编辑:程序博客网 时间:2024/05/05 17:46
select t1.id as productid,t1.productname,t1.saleunitprice,t1.storeid,t1.status,t1.mainimage as url from ProductInfo t1  where t1.status=1 and t1.mainimage is not null and  rownum<=30order by id desc,(case updatedtime when null then createdtime else  updatedtime  end) desc