Question

I have been trying to find a way to join two tables on two column identifiers. ie in "pseudo-query":

 join table1 to table2 where table1.x = table2.y and table1.a = table2.b

Can I do this using a join statement without using a where statement explicitly? Or would it just be best to do select from table1,table2 where x=y and a=b? Thanks for the suggestions!

Was it helpful?

Solution

You could use a from clause like this:

from table1 inner join table2 on table1.x = table2.y and table1.a = table2.b

OTHER TIPS

Sure you can:

select
 *
from
    table1 a join table2 b on 
       (a.some_column = b.some_column and a.other_column = b.other_column)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top