0

我在执行查询时收到以下错误“ORA-00923:FROM 关键字未在预期的地方找到”,注意:已经在使用此查询与不同的表及其工作,所以我需要你的帮助:)


LOAD * ,
date(POST_DATE,'MM/DD/YYYY') as VOU_POST_DATE,
date(CREATED_DATE,'MM/DD/YYYY') as VOU_CREATED_DATE,
year (POST_DATE) as VOU_POST_YEAR ,
month (POST_DATE) as VOU_POST_MONTH,
day (POST_DATE) as VOU_POST_DAY, 
year (CREATED_DATE) as VOU_CREATED_YEAR ,
month (CREATED_DATE) as VOU_CREATED_MONTH,
day (CREATED_DATE) as VOU_CREATED_DAY;

Select 
t.QTY as VOU_QTY,
t.COST as VOU_COST,
t.PRICE as VOU_PRICE,
t.QTY*t.COST as VOU_EXT_COST,
t.QTY*t.PRICE as VOU_EXT_PRICE,
t.ITEM_SID,
o.STORE_NO as VOU_STORE_NO,
o.VOU_NO,
o.VOU_TYPE, 
o.VOU_CLASS,
o.VEND_CODE as VOU_VEND_CODE,
o.SLIP_FLAG,
o.TO_NO,
o.REF_VOU_SID,
o.CREATED_DATE,
o.POST_DATE,
o.SLIP_FLAG as SLIP_FLAGS,
o.VERIFIED,
st.QTY as TRANS_OUT_QTY
s.OUT_STORE_NO as SLIP_OUT_STORE,
s.IN_STORE_NO as SLIP_IN_STORE,


CASE
when o.VEND_CODE is not NULL
and o.TO_NO is NULL 
then t.QTY
else 0
end CMP_RCVD_QTY,


CASE
when o.VEND_CODE is NULL 
and o.TO_NO is not NULL 
then t.QTY
else 0
end FST_RCVD_QTY,


CASE
when o.VEND_CODE is NULL 
and o.TO_NO is NULL 
then t.QTY
else 0
end TRANS_IN_QTY,

CASE
when o.VOU_CLASS=2 
then t.QTY
else 0
end ASN_QTY,

from VOUCHER o
join VOU_ITEM t
on o.VOU_SID = t.VOU_SID 

Join SLIP s
on s.VOU_SID = o.VOU_SID 

join  SLIP_ITEM st
on st.ITEM_SID = t.ITEM_SID
where 
o.HELD=0 and o.REF_VOU_SID is NULL;
4

1 回答 1

0

,之后添加TRANS_OUT_QTY

o.VERIFIED,
st.QTY as TRANS_OUT_QTY
s.OUT_STORE_NO as SLIP_OUT_STORE,

,并从子句中删除之前。

CASE
when o.VOU_CLASS=2 
then t.QTY
else 0
end ASN_QTY,

from VOUCHER o
join VOU_ITEM t
on o.VOU_SID = t.VOU_SID

Oracle 期望FROM关键字在我们结束逗号分隔的列列表的位置。如您所见,您忘记在它之后输入,after st.QTY as TRANS_OUT_QTYit expectsFROM子句,因此错误ORA-00923: FROM keyword not found where expected

一旦你修复了第一个语法错误,你将遇到另一个错误ORA-00936: missing expression,因为你提供了额外的,这表明在,之后end ASN_QTY,有更多的表达式,,但没有。

于 2017-05-21T09:48:25.703 回答