Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Left Outer Join Help...

cjpicc11Aug 22 2013 — edited Aug 22 2013

Hi Everyone,

I am still in the process of learning SQL, and I am having trouble specifically with the the left outer join.  I normally join tables using equijoin's, but I am not getting the right data set returns, and thought the using a left or right outer join would resolve the problem...

Here is my SQL that is working properly with 1 left outer join.  I am building the query slowly so in the next SQL you will see where I am seeing the error.  I don't expect you to understand the data and columns I am trying to join, I believe the problems I am experiencing are related to syntax, and I am hoping you can find where my syntax errors are.

select

  s.name as "Screen Name",

  sv.view_name as "View Name",

  s_view.name

from

  s_screen s,

  s_screen_view sv

  left outer join s_view

  ON (sv.view_name = s_view.name)

where

  sv.screen_id = '1-866A-1X3LU' and

  s.row_id = sv.screen_id and

  s.repository_id = '1-866A-1' and

  s_view.repository_id = '1-866A-1';

Here is the SQL where I am experiencing the following error...

Error:

ORA-00904: "SV"."VIEW_NAME": invalid identifier

00904. 00000 -  "%s: invalid identifier"

*Cause:   

*Action:

Error at Line: 14 Column: 7

Problematic SQL:

select

  s.name as "Screen Name",

  sv.view_name as "View Name",

  s_view.name,

  s_applet.name as Applet

  --a.name as "Applet Name"

from

  s_screen s,

  s_screen_view sv,

  s_view_wtmpl_it wti

  left outer join s_view

  ON (sv.view_name = s_view.name)

  left outer join s_applet

  ON (wti.name = s_applet.name)

where

  sv.screen_id = '1-866A-1X3LU' and

  s.row_id = sv.screen_id and

  s.repository_id = '1-866A-1' and

  s_view.repository_id = '1-866A-1';

Thanks in advance for your help.

Chris

This post has been answered by SomeoneElse on Aug 22 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 19 2013
Added on Aug 22 2013
10 comments
1,489 views