2015-11-04 53 views
2

我正在使用Oracle 8i。當我試圖運行下面的腳本時,我得到錯誤ora-00923從關鍵字找不到預期的地方。查詢發生錯誤ora-00923關鍵字找不到預期的地方

請找到我正在使用的下面的查詢。

select i.siid, 
     sp.access_point_status, 
     csp.id_number, 
     act.entry_time, 
     act.addnl_info, 
     row_num() over (partition by i.siid order by act.entry_time desc) act_row 
from table_Service_point sp, 
     table_case_to_service_point csp, 
     table_case cs, 
     table_act_entry act, 
     (select distinct siid, 
       iopt.installedopts2axspoint 
     from table_installed_options iopt, 
      tmp_efms_clarify inp 
     where iopt.siid = inp.service_instance 
     and iopt.siid = 'DSL580155-105-1') i 
where sp.objid = csp.case2servicepoint 
    and csp.id_number = cs.id_number 
    and cs.objid = act.act_entry2case 
    and sp.objid = i.installedopts2axspoint 
+0

那古老的8i版本的哪個_exact_版本?窗口函數(又名「分析函數」)在8.1中添加 - 它們在8.0中不可用(爲什麼你仍然使用一個已經被十年支持的版本?) –

回答

0

單引號''oracle表示characters,不names

更換

iopt.siid='DSL580155-105-1' 

iopt.siid="DSL580155-105-1" 
+0

你怎麼知道有一個列名爲'「DSL580155-105-1」'?另外:這對Oracle來說並不是特別的。 SQL標準定義字符文字用單引號括起來,標識符用雙引號引起來。 –

1

嘗試使用ROW_NUMBER(),而不是ROW_NUM()。

相關問題