Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mysql join 3 tables

Tags:

php

mysql

How can I join three mysql tables which have one common column (id), For example, Select a, b from Table1, select c,d from table2, select e,f from table3, where id=x Thanks

like image 854
kks Avatar asked Apr 06 '26 17:04

kks


1 Answers

 SELECT t1.a, t1.b, t2.c, t2.d, t3.e, t3.f
  FROM table1 t1
  JOIN table2 t2 ON (t1.id = t2.id) 
  JOIN table3 t3 ON (t1.id = t3.id)
  ORDER BY t1.id;
like image 127
Imran Khan Avatar answered Apr 09 '26 05:04

Imran Khan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!