【发布时间】:2017-03-29 09:37:03
【问题描述】:
在我的表ALI_LEASE_IN,我有一个DEF14字段,(对不起红框,选择DEF16),你可以在我的快照中看到。
但是当我执行查询sql时:
select b.equip_name a2,b.model b3,b.def2 c4,b.def3 d5,
ALI_LEASE_IN.DEF14 as e6,
'' f7,
To_char(b.pre_rent) h9,
b.start_date k10,
sup.name j11,
org.name l12,
b.memo o13,
h.bill_date bdate,
h.pk_group
from ali_lease_in_b b,ali_lease_in h,bd_supplier sup,org_itemorg org
where b.pk_lease_in=h.pk_lease_in
and h.pk_supplier=sup.pk_supplier
and b.pk_org=org.pk_itemorg
但我在下面收到此错误:
[SQL]select b.equip_name a2,b.model b3,b.def2 c4,b.def3 d5,
ALI_LEASE_IN.DEF14 as e6,
'' f7,
To_char(b.pre_rent) h9,b.start_date k10,sup.name j11,org.name l12, b.memo o13,h.bill_date bdate,h.pk_group
from ali_lease_in_b b,ali_lease_in h,bd_supplier sup,org_itemorg org
where b.pk_lease_in=h.pk_lease_in
and h.pk_supplier=sup.pk_supplier
and b.pk_org=org.pk_itemorg
--and h.pk_org in (parameter('param3'))
-- and substr(h.bill_date,1,10) >= parameter('param1')
-- and substr(h.bill_date,1,10) <= parameter('param2')
[Err] ORA-00904: "ALI_LEASE_IN"."DEF14": invalid identifier
我不知道为什么,我的快照显示 DEF14 存在于我的表中。
我的环境是:
数据库是Oracle, 可视化软件是navicat。
【问题讨论】:
-
尝试用
h.DEF14替换您选择中的ALI_LEASE_IN.DEF14,该字段是ALI_LEASE_IN表的一部分,在您的FROM子句中别名为h。