【发布时间】:2016-01-21 17:40:23
【问题描述】:
我在尝试执行以下查询时收到 ORA-9005:缺少关键字错误。
select a.OBJID,
A.TITLE,
a.id_number,
a.creation_time,
a.case_reporter2contact,
a.x_rev_esc_prim_reason,
a.x_rev_esc_sec_reason,
a.x_esc_third_reason,
b.x_channel_source,
b.x_verification,
b.x_followup_status,
b.x_saves_status,
b.x_saves_reason,
b.x_cust_mislead_flag,
b.x_cust_mislead_reason,
b.x_create_dt,
b.x_update_dt
from table_case a, table_x_saves_case_info b
INNER JOIN (SELECT case_reporter2contact,
MAX(trunc(creation_time)) as latest_date
FROM table_case
WHERE calltype2gbst_elm = '268436012'
AND x_activity_code = 'DO Drop Off'
GROUP BY case_reporter2contact) as q
ON a.case_reporter2contact = q.case_reporter2contact
and q.latest_date > trunc(a.creation_time)
where a.objid = b.x_saves_case_info2case
and a.x_esc_primary_reason = 'Rental Inbound'
and a.x_esc_secondary_reason in ('Buy-Out', 'Pick-Up', 'Drop-Off')
and b.x_channel_source in ('Third Party Call',
'Third Party Email',
'Third Party Fax',
'Third Party Mail')
and b.x_followup_status in ('2nd Attempt Complete', 'Complete')
order by b.x_create_dt DESC
它突出显示来自
的“AS”MAX(trunc(creation_time)) as latest_date
和
GROUP BY case_reporter2contact) as q
在甲骨文 10g 上
【问题讨论】:
-
如果您为表“TABLE_CASE”设置别名并将其应用于选择是否有效?如 SELECT a.case_reportercontact,....from TABLE_CASE a
-
对不起kevnisky..我没有关注..你的意思是这样吗?来自“TABLE_CASE”a、table_x_saves_case_info b 和 FROM“TABLE_CASE”。如果是这样,不,它不起作用,同样的结果。
标签: sql oracle oracle10g keyword