• 数据库语言之查询客户下过的生产订单


      select DISTINCT t0.name 客户名,t1.partner_id 客户ID,
    t2.name  品名 ,t6.material as 材质,t6.cust_spec as 规格,t2.price_unit  单价,t4.name 单位,

    case....when...then....else...end用法
      case t3.packing_type1 when '1' then '隔板' when '2' then '泡沫' else '' end 包装方式
    from  res_partner  t0
    LEFT JOIN sale_order t1  on  t0.id=t1.partner_id
    LEFT JOIN sale_order_line t2  on t2.order_id=t1.id
    LEFT JOIN sale_origin_line t3 on  t2.order_id=t3.order_id
    LEFT JOIN product_uom t4 on t4.id=t2.product_uom
    left join product_product t5 on t5.id=t2.product_id
     left join product_template t6 on t6.id=t5.product_tmpl_id
    where  t1.partner_id is not null
    and  t0.name='保定韩冠军'
    ORDER BY t0.name DESC
    ;

  • 相关阅读:
    Alpha发布——美工+文案展示博客
    021_func
    020_with
    018_IO
    017_set
    016_dict
    015_string
    012_list
    010_ternaryOperation
    008_standard_lib_os
  • 原文地址:https://www.cnblogs.com/1314520xh/p/6863704.html
Copyright © 2020-2023  润新知