All Forums Database
rediff123 14 posts Joined 02/09
05 Oct 2009
Subquery returns more than one value

I need to join two tables that have no direct relation.
so another table has to be taken to join them

for ex:

Sel col_12, col_34

from table_a A
inner join table_b B

where B.col_sd= (sel C.col_sd
from table_a A
JOIN
table_c C
where A.col_sc= C.col_sc)

The subquery returns more than one column.
what to do?
help me on this plz....

pawan0608 67 posts Joined 12/07
06 Oct 2009

Why are you using sub query? You can join them in same query like below

SEL
col_12, col_34
from table_a A
inner join table_c C
on A.col_sc = C.col_sc
inner join table_b B
on B.col_sd = C.col_sd

R lal 6 posts Joined 09/09
06 Oct 2009

This is correct.

You must sign in to leave a comment.