SQL Language (MOSC)

MOSC Banner

Query while trying to join tables

edited Mar 14, 2012 3:45AM in SQL Language (MOSC) 4 commentsAnswered
Hi,

I have to join 4 tables(T1-T4) to get some 'n' rows of data in say 3 columns. I am able to do it. In addition to this I need to populate each of these n rows, 3 columns with 2 additional columns from a different table(T7), which is related to only one of the 6 tables say(T3).

select T1.X, T2.Y, T4.z from T1, T2, T3, T4
where T1.C1=T2.P1 and T3.C1=T2.C1 and T1.P1=T4.X1 and T4.Y='abc';

OUTPUT1:
T1.X    T2.Y    T4.Z
----      ----      ----
1111   str1     val2

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center