Sql ORA-00904:“参数”:无效标识符
当我执行SQL时,我得到一个错误: 选择bd.name aaa, sump.nassisnum HH,当p.vbdef4='~'然后是'0'时的sumcase,否则p.vbdef4结束KK 来自ic_purchasein_b p、bd_marbasclass bd、bd_material_v m、ic_purchasein_h 其中m.pk_source=p.cmaterialvid p.cgeneralhid=h.cgeneralhid bd.code=substrm.code,0,4 和m.creator='1001A21000000000IIQ' 和h.vdef8='1001A210000000FUD01' 和h.ctrantypeid='1001A21000000002UXJ' 参数'param3'中的h.pk_org 和substrh.dbilldate,1,10>=参数'param1' 以及第1,10页的子标题dbilldate ORA-00904字符串:标识符无效原因:输入的列名为 要么丢失,要么无效 操作:输入有效的列名。有效的列名必须以开头 一个字母,少于或等于30个字符,且仅由 字母数字字符和特殊字符$、\和。如果是 包含其他字符,则必须用双精度 引号。它可能不是保留字 您可能只需要重新检查查询中的列名和函数Sql ORA-00904:“参数”:无效标识符,sql,oracle,Sql,Oracle,当我执行SQL时,我得到一个错误: 选择bd.name aaa, sump.nassisnum HH,当p.vbdef4='~'然后是'0'时的sumcase,否则p.vbdef4结束KK 来自ic_purchasein_b p、bd_marbasclass bd、bd_material_v m、ic_purchasein_h 其中m.pk_source=p.cmaterialvid p.cgeneralhid=h.cgeneralhid bd.code=substrm.code,0,4 和m.
而且一定要考虑@Alex Poole的评论。参数是您编写的函数吗?“它不是一个buolt-in-one。@Alex Poole,我终于发现parameter方法是自定义环境中的自创建方法。
select DISTINCT aaa,sum(HH) sum1,sum(KK) sum2 from
( select bd.name aaa,
sum(p.nassistnum) HH,sum(case when p.vbdef4='~' then '0' else p.vbdef4 end) KK
from ic_purchasein_b p,bd_marbasclass bd,bd_material_v m ,ic_purchasein_h h
where m.pk_source=p.cmaterialvid
and p.cgeneralhid= h.cgeneralhid
and bd.code=substr(m.code,0,4)
and m.creator='1001A210000000000IIQ'
and h.vdef8='~'
and (h.ctrantypeid='1001A210000000002UXJ' or h.ctrantypeid='1001A210000000002UW7' or h.ctrantypeid='1001A210000000002UY9')
and h.pk_org in (parameter('param3'))
and substr(h.dbilldate,1,10) >= parameter('param1')
and substr(h.dbilldate,1,10) <= parameter('param2')
group by bd.name
UNION
select bd.name aaa,
sum(p.nassistnum) HH,sum(case when p.vbdef4='~' then '0' else p.vbdef4 end) KK
from ic_purchasein_b p,bd_marbasclass bd,bd_material_v m ,ic_purchasein_h h
where m.pk_source=p.cmaterialvid
and p.cgeneralhid= h.cgeneralhid
and bd.code=substr(m.code,0,4)
and m.creator='1001A210000000000IIQ'
and h.vdef8='1001A2100000000FUD01'
and h.ctrantypeid='1001A210000000002UXJ'
and h.pk_org in (parameter('param3'))
and substr(h.dbilldate,1,10) >= parameter('param1')
and substr(h.dbilldate,1,10) <= parameter('param2')
group by bd.name) group by aaa