MySQL » Joins

Left Join

Each item in the left table will show up in a MySQL result, even if there isn’t a match with the other table that it is being joined to.

select * from t_customers
left join t_customers_config
ON t_customers.user_id = t_customers_config.user_id

Posted by Mark on December 8th, 2009 under Joins, MySQL  •  No Comments

MySQL Joins

3 table join:

select * from table1, table2, table3
where table1.id = table2.id
AND table1.id = table3.id
AND table2.status = ‘Live’
AND table3.package = 1
etc…

2 table join:

select * from table1, table2
where table1.id = table2.id
AND table2.status = ‘Live’
etc…

Posted by Mark on November 27th, 2009 under Joins, MySQL  •  No Comments