Senior
Milliseid JOIN-tüüpe te tead?
sobes.tech AI
Vastus AI-lt
Main types of JOINs I know and use:
- INNER JOIN — returns only the records that match in both tables.
- LEFT JOIN (LEFT OUTER JOIN) — returns all records from the left table and the matching ones from the right, if no match — NULL.
- RIGHT JOIN (RIGHT OUTER JOIN) — similar to LEFT JOIN, but for the right table.
- FULL JOIN (FULL OUTER JOIN) — returns all records from both tables, where there is no match — NULL.
- CROSS JOIN — Cartesian product of two tables.
Depending on the task, I choose the appropriate JOIN type to obtain correct data and optimal performance.