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
    

      

  • 相关阅读:
    [poj 1741]Tree 点分治
    [bzoj 3251]树上三角形
    [bzoj 3687]简单题 bitset的运用
    HDU [P5015] 233 Matrix
    POJ 3233
    洛谷 [P3629] 巡逻
    POJ 2728 Desert King
    洛谷 [P2886] 牛继电器Cow Relays
    POJ 1734 Sightseeing trip
    洛谷 [P3008] 道路与航线
  • 原文地址:https://www.cnblogs.com/EveningWind/p/10033090.html
Copyright © 2011-2022 走看看