sql - Query using 3 tables of database -


i working on queries oracle 10g database. facing problem.it follow :

i having 3 tables table1,table2,table3.

now in table1 suppose have 2 columns myid,id.

in table2 suppose have 2 columns table2id,table2name.

in table3 suppose have 2 columns table3id,table3name.

now want myid,id,name tables have particular myid,say x.

example : table 1 having 3 entries :

1 11 2 11 3 13 

table 2 follow :

11 john 12 michael 

table 3 follow :

13 steve 

then here answer :

1 11 john 2 11 john 3 13 steve 

how ?

try bellow:

select table1.myid, table1.id,table2.name name  table1  inner join table2 on table2.id = table1.id  union   select table1.myid, table1.id,table3.name name  table1  inner join table3 on table3.id = table1.id; 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -