I have two tables tbl_a and tbl_b and their fields are
tbl_a
-----
a_id a_name a_surname a_c_id a_d_id
tbl_b
-----
b_id b_name b_phone b_c_id b_d_id
I want to join these two table like this:
select *from tbl_a join tbl_b on tbl_a.a_c_id=tbl_b.b_c_id AND tbl_a.a_d_id=tbl_b.b_d_id where tbl_a.id>15;
As you can see i want to use two keys for ON keyword,is there anyway to do this?
Thanks for advance…
Your query is right there is no need for putting extra On keyword
AND keyword do work of join in on two different columns. Just put the bracket to understand properly.