I have 3 tables; A
,B
,C
A
is in relation with B
and B
is in relation with C
I want to use select query on A
and take a column of C
in the query
Using inner join, I can only reach B
but I want to reach C
which has no direct relation with A
In this case you need to use 2 inner joins
to get data from tablec
like following.
select a.*,c.coltoselect
from tablea a
inner join tableb b on a.abcommoncolumn=b.abcommoncolumn
inner join tablec c on b.bccommoncolumn=c.bccommoncolumn