문제

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!

도움이 되었습니까?

해결책

You could use a from clause like this:

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

다른 팁

Sure you can:

select
 *
from
    table1 a join table2 b on 
       (a.some_column = b.some_column and a.other_column = b.other_column)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top