首页 > 代码库 > case when 的实战应用
case when 的实战应用
SELECTlg.product_id,lg.goods_id,lg.goods_no,lg.product_price,lg.product_stock,lg.limit_amount,lg.is_delivery_free,lg.limit_order,lg.state,gs.MARKET_PRICE,lg.standby1 AS kan_product_stock,sg.goods_name,<![CDATA[(CASE WHEN lg.LIMIT_GOODS_IMG IS NOT NULL THEN lg.LIMIT_GOODS_IMG ELSE sg.goods_list_imgEND) AS goods_list_img, ]]>sg.goods_price,lg.cu_titleFROMT_LIMIT_GOODS lg,shop_common_goods sg,(SELECTgg.market_price,gg.goods_idFROMproduct pp,goods ggWHEREgg.PRODUCT_ID = pp.product_idAND pp.is_onsale = ‘Y‘AND pp.is_delete = ‘N‘AND gg.is_delete = ‘N‘) gsWHERElg.goods_id = sg.goods_id(+)AND lg.goods_id = gs.goods_idAND lg.is_delete = ‘N‘AND sg.is_delete = ‘N‘AND lg.state = ‘enable‘AND <!
[CDATA[ to_date(lg.limit_begin_time, ‘YYYY/MM/DD hh24:mi:ss‘)<=to_date(#{limitEndTime}, ‘YYYY/MM/DD hh24:mi:ss‘)]]>AND sg.goods_type = #{goodsType}AND lg.field_id = #{fieldId}ORDER BY lg.LIMIT_ORDER
case when 的实战应用
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。