2017-01-08 25 views
0

エラーが発生するのはなぜですか?Sqlエラー「無効な識別子」

create or replace view PROD as 
    select 
    mytable.name as description 
    from table_name mytable 
    join another_table another on another.id in (
     select mytable1.id 
     from table_name mytable1 
     start with mytable1.id = mytable.id 
     connect by prior mytable1.id = mytable1.parent_id); 
Error at Command Line:8 Column:41 
Error report: 
SQL Error: ORA-00904: "MYTABLE"."ID": invalid identifier 
00904. 00000 - "%s: invalid identifier" 
*Cause:  
*Action: 

これは実際にローカルデータベースのインストールで機能します。しかし、他にはありません。 Oracleデータベース上で実行。

はありがとう

+1

別名を使用してみてください: 'table'は予約語なので、別名として使用しない方が良いです。 – Aleksej

+1

また、' desc'はテーブルエイリアスを変更した後に発生する次のエラーである予約キーワードです。 –

+0

私は実名を公開したくありませんのでテーブルに変更してください – Smolda

答えて

0

バージョンの問題:

  1. のOracle Database 11gのEnterprise Editionのリリース11.2.0.1.0 - 生産
  2. のOracle Database 12cのStandard Editionのリリース12.1.0.2.0 - 64ビット プロダクション

ここで1.は、この構文が機能しないものです。

関連する問題