SQL: JOIN
SQL içinde JOIN konusunu örneklerle öğren.
SQL — JOIN
Genel Bakış
JOIN iki tabloyu ilişkili anahtar ile birleştirir.
Öğreneceklerin
- INNER JOIN
- LEFT JOIN
- ON koşulu
- alias
Sözdizimi
SELECT ... FROM a JOIN b ON a.id=b.a_id;
Örnek
SELECT u.name, o.total
FROM users u
JOIN orders o ON o.user_id = u.id
ORDER BY o.total DESC;
Notlar
- Join anahtarlarını index'le.
- LEFT JOIN soldaki satırları korur.
Kendin Dene: Playground aç: /tr/playground/sql