Search code examples
sqlintersystems-cache

Join table using two identifiers not just one


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!


Solution

  • You could use a from clause like this:

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