0
CD20160914 Lv8 专家互助 发布于2022-4-20 14:30(编辑于 2022-4-20 14:38)
不是单引号
是 `count`
注意这个符号是键盘上面区域数字1前面的那个符号。。。。就是esc键盘下面的那个符号。。。
select distinct
a.id ID
,a.serial_no '序号'
,a.case_no '箱号'
,a.issue_status '下发状态'
,a.issue_date '下发日期'
,a.material_code '物资编码'
,a.chinese_name '中文名称'
,a.english_name '英文名称'
,a.specification '规格型号'
,a.product_standard '产品执行标准'
,a.unit '单位'
,a.num '数量'
,a.unit_price '单价'
,a.price '金额'
,a.supplier_name '供应商名称'
,a.purchase_plan_num'采购计划编号'
,a.contract_num '合同号'
,a.order_num 'erp订单号'
,a.order_row_num 'erp订单行号'
,a.purchaser '采办人'
,a.project_area '项目区域'
,a.arrival_time '到货时间'
,a.transport_plan_num '运输计划号'
,a.send_status '发运状态'
,a.send_time '发运时间'
,a.odd_no '核销单号'
,a.declare_sort '报关分类性质'
,a.exit_type '永久/临时'
,a.fictitious_no '虚拟核销单号'
,a.declare_code '报关单商品编号'
,a.declare_name '报关单商品名称'
,a.declare_unit '报关单主计量单位'
,a.declare_num '报关单数量'
,a.declare_price '报关单价USD'
,a.declare_Total '报关总价USD'
,a.remark '备注'
,a.drawback_status '退税状态'
,a.drawback_price '退税金额'
,a.tax_rate '税率'
,a.drawback_remark '备注'
,a.packing_method '包装方式'
,a.longer '长'
,a.wide '宽'
,a.height '高'
, a.volume '体积'
,a.net_weight '净重'
,a.gross_weight '毛重'
,a.arrival '是否到港'
,a.arrival_timee '到港时间'
,a.carry_forward_amount '结转金额'
,a.carry_forward_remark '结转备注'
,a.carry_forward_status '结转状态'
,c.* from material_oversea_despatch a left join (select purchase_order_num
,material_code
,amount_in_local_currency/`count` as '单价' from material_oversea_warehousing_in group by purchase_order_num
,material_code
,amount_in_local_currency/`count`) c on a.material_code=c.material_code and a.order_num=c.purchase_order_num where 1=1 and a.send_time >= '2022-04-01 00:00:00' and a.send_time <= '2022-04-17 23:59:59' and a.issue_status="1" and a.send_status!="0" Order By a.send_time Desc
用户DRQXF9153762(提问者)
- 我的问题描述里有用过这个哦!
CD20160914 回复 用户DRQXF9153762(提问者)
- 你看我的是不会报错的。。。你把你的语句复制出来。。。你是mysql吗
用户DRQXF9153762(提问者) 回复 CD20160914
- 是mysql噢!用``确实没有报错 上面的报错是用的\'\'和\"\"报的错
用户DRQXF9153762(提问者) 回复 CD20160914
- select distinct a.id ID,a.serial_no \'序号\',a.case_no \'箱号\',a.issue_status \'下发状态\',a.issue_date \'下发日期\',a.material_code \'物资编码\',a.chinese_name \'中文名称\',a.english_name \'英文名称\',a.specification \'规格型号\',a.product_standard \'产品执行标准\',a.unit \'单位\',a.num \'数量\',a.unit_price \'单价\',a.price \'金额\',a.supplier_name \'供应商名称\',a.purchase_plan_num\'采购计划编号\',a.contract_num \'合同号\',a.order_num \'erp订单号\',a.order_row_num \'erp订单行号\',a.purchaser \'采办人\',a.project_area \'项目区域\',a.arrival_time \'到货时间\',a.transport_plan_num \'运输计划号\',a.send_status \'发运状态\',a.send_time \'发运时间\',a.odd_no \'核销单号\',a.declare_sort \'报关分类性质\',a.exit_type \'永久/临时\',a.fictitious_no \'虚拟核销单号\',a.declare_code \'报关单商品编号\',a.declare_name \'报关单商品名称\',a.declare_unit \'报关单主计量单位\',a.declare_num \'报关单数量\',a.declare_price \'报关单价USD\',a.declare_Total \'报关总价USD\',a.remark \'备注\',a.drawback_status \'退税状态\',a.drawback_price \'退税金额\',a.tax_rate \'税率\',a.drawback_remark \'备注\',a.packing_method \'包装方式\',a.longer \'长\',a.wide \'宽\',a.height \'高\',
a.volume \'体积\',a.net_weight \'净重\',a.gross_weight \'毛重\',a.arrival \'是否到港\',a.arrival_timee \'到港时间\',a.carry_forward_amount \'结转金额\',a.carry_forward_remark \'结转备注\',a.carry_forward_status \'结转状态\',c.*
from material_oversea_despatch a
left join (select purchase_order_num,material_code,amount_in_local_currency/count \'单价\' from material_oversea_warehousing_in
group by purchase_order_num,material_code,amount_in_local_currency/count) c on a.material_code=c.material_code and a.order_num=c.purchase_order_num
where 1=1
and a.send_time >= \'2022-04-01 00:00:00\' and a.send_time <= \'2022-04-17 23:59:59\'
and a.issue_status=\"1\"
and a.send_status!=\"0\"
Order By a.send_time Desc
CD20160914 回复 用户DRQXF9153762(提问者)
- 斜杠是论坛回复中自己加的。。。。
取消
评论