【发布时间】:2014-02-14 07:29:24
【问题描述】:
我在 Oracle 11g 中运行这个查询没有问题:
select (case
when seqnum = 1 then
'1'
when seqnum = cnt then
'0'
end) as value1,
(case
when seqnum = 1 then
t.BEGIN_DT
when seqnum = cnt then
t.END_DT
end) as TIME1,
t4.UNIT1 || '.SUBBATCH_TRIGGER' TAG
from (select t.*,
row_number() over(partition by t.BATCH_ID, t.plant_unit, t3.ID2 order by t.BEGIN_DT) as seqnum,
count(*) over(partition by t.BATCH_ID, t.plant_unit, t3.ID2) as cnt
from SCH2.tb_pg_unit_stap t
join (select ID1,batch_id from SCH2.VW_BATCH) t2 on t.BATCH_ID = t2.BATCH_ID
join (select ID2,ID1 from SCH1.STEP) t3 on t3.ID1 = t2.ID1) t
join SCH2.TB_W_MACHINE t4 on t4.plant_unit = t.plant_unit
where (seqnum = 1
or seqnum = cnt) AND (t.BEGIN_DT > '01-jan-2013' AND t.BEGIN_DT < '01-feb-2013');
但是当我在 Oracle 8i (8.7.1) 中运行它时,它会给出 ORA-00933: SQL command not properly end.
在 Oracle 8i 中运行 sql 命令有什么特别需要注意的吗?
提前致谢
【问题讨论】:
-
8i 版本的 Oracle 不支持 ANSI 连接语法(在 9iR2 中引入)。您将使用逗号 (
,) 连接表示法(交叉连接)重写查询,并将连接条件放在查询的where子句中。 -
oracle 8i:扩展支持结束 2006 年 12 月 31 日(……颤抖……)
-
我知道这是一个非常旧的版本,但我只是在开发一些 .NET 的东西,我需要在那里运行这个查询......这是客户端的数据库