what query for join 3 tables or more | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

what query for join 3 tables or more

20th Jul 2016, 3:46 PM
YUYUS
YUYUS - avatar
5 Answers
+ 2
select a.col,o.m.,o.n from a join (select b.col as m,c.col as n from a join b on b.id as id =a.id) as o on a.id=o.id;
20th Jul 2016, 5:23 PM
manish rawat
manish rawat - avatar
+ 2
Clarify your question. Do you want all info from 3 or more tables or just specific info? You can use SELECT table1.*, table2.*, table3.* FROM table1, table2, table; Or SELECT table1.*, table2.*, table3.* FROM table1 JOIN table2 ON (appropriate check here) JOIN table3 ON (appropriate check here);
31st Jul 2016, 6:52 AM
 - avatar
+ 1
select * from table1,tablr2,table3;
9th Aug 2016, 4:01 PM
Aakash Sharma
Aakash Sharma - avatar
0
thanks all
23rd Jul 2016, 3:57 PM
YUYUS
YUYUS - avatar
- 1
select e.first_name,d.department_name,l.city from employees e join departments d on e.department_id = d.department_id join locations l on d.location_id = l.location_id; or select e.first_name,d.department_name,l.city from employees e join departments d using (department_id) join locations l using (location_id);
22nd Jul 2016, 5:32 PM
Saurabh Joshi
Saurabh Joshi - avatar