Inner join:
SELECT users.name, phones.phone FROM `phones` INNER JOIN users ON users.ID = phones.userID
Left join:
SELECT users.name, phones.phone FROM `users` LEFT JOIN `phones` ON users.ID = phones.userID
Right join:
SELECT users.name, phones.phone FROM users RIGHT JOIN phones ON users.ID = phones.userID
No comments:
Post a Comment