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
    

      

  • 相关阅读:
    pandas之中文分词,词云,情感分析,语义分析3
    pandas之中文分词,词云,情感分析,语义分析2
    pandas之中文分词,词云,情感分析,语义分析1
    大数据学习之-the king of bigdata
    pandas之分组聚合(agg,apply)
    pandas之表的长宽转换
    Pandas数据规整之合并
    Pandas之数据规整
    Pandas数据规整
    IP协议那些事
  • 原文地址:https://www.cnblogs.com/EveningWind/p/10033090.html
Copyright © 2011-2022 走看看