zoukankan      html  css  js  c++  java
  • mysql if...else 的使用

    select
            case when tca.id = '3' then 'vw'  else epc_code end as epccode,tfp.product_id, tfp.vender, tfp.spec_id, tfp.product_classify, tfp.supplier_id, tfp.classify, tfp.category, tfp.texture,
            tfp.stand_name, tfp.another_name, tfp.spec_name, tfp.spec_m, tfp.oem, tfp.factorynum, tfp.pics, tfp.unit, tfp.pac_spec,
            tfp.ourc_price, tfp.price, tfp.exp_date, tfp.capacity, tfp.stock_max, tfp.explains, tfp.goods_max, tfp.business_type,
            tfp.is_special, tfp.is_audit, tfp.is_show_company, tfp.is_show_brand, tfp.is_show_business, tfp.special_begin_time,
            tfp.special_end_time, tfp.market_enable, tfp.buy_count, tfp.remark, tfp.status, tfp.order_min, tfp.create_time,
            tfp.update_time, tfp.retail_price,tfp.master_graph,tar.local_name AS cityName ,
            tea.local_name AS provinceName,taq.quality_name AS qualityName,
    
            tpt.name AS classifyName,taso.special_price AS specialPrice
            from
            t_full_product_ford tfp
            left join t_company  tm ON tm.com_id = tfp.supplier_id
            LEFT JOIN t_area tea ON tm.province_id = tea.id
            LEFT JOIN t_area tar on tar.id = tm.city_id
            left join t_data_quality taq ON taq.quality_id = tfp.spec_id
            left JOIN  t_product_type tpt ON  tpt.s_id = tfp.category
            LEFT JOIN t_admin_special_offer taso on taso.product_id=tfp.product_id
    				LEFT JOIN t_car_vender tca on tca.id=tfp.vender and epc_code=taso.table_name
            and taso.is_effective = 0
            and taso.end_time_special > now()
            and now() > taso.start_time_special_off
            where tfp.product_id = 1 and  tfp.market_enable = 1
    

      

  • 相关阅读:
    [JLOI2015] 管道连接
    【知识点】斯坦纳树
    [ZJOI2010] 网络扩容
    【知识点】网络流常见模型
    [NOI2009] 植物大战僵尸
    [NOI2007] 货币兑换
    【知识点】分治相关算法
    [NOI2005] 月下柠檬树
    [HNOI2012] 射箭
    [SDOI2014] 向量集
  • 原文地址:https://www.cnblogs.com/EveningWind/p/10033090.html
Copyright © 2011-2022 走看看