as case when 报错_sql报错ORA-00905 缺少关键字,实在找不出错误来

select H.outbill_no,--出货单号

H.source_bill_no,--订单号

c.order_type_name,--订单类型

to_date(fn_get_order_outdate(oh.order_no) ,"dd-mm-yy")as old_out_date,--原需求日期

oh.out_date,--现需求日期

H.OUTBILL_DATE,--出货日期

CRM_CUST.Short_Name,--客户简称

ci.item_code,--物料编码

ci.Draw_Id,--机型

case when getItemStatWithQtyLmt(oh.factory_id,0,oh.draw_id,'''',0)=2 then "已认定已认定" else "未认定未认定" end as item_stat,

(case

when H.source_bill_type =1then "销售出货"

else

case

when H.source_bill_type =2then "退货入库"

else

case

when H.source_bill_type =3then "调拨出库"

else

case

when H.source_bill_type =14then "账面出库"

else

end

end

end

end ),

from crm_outbill_header H,

CRM_CUST,

crm_saleorder_header oh,

Crm_SaleOrder_Type c,

crm_item ci

WHERE H.CUST_ID = CRM_CUST.CUST_ID

and h.source_bill_no=oh.order_no

and oh.order_type=c.order_type

and h.item_id=ci.item_id

and H.stat <> 5

and H.source_bill_type in(1,14)

and H.warehouse_id = 1

and H.item_id = 1

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值