INNER JOIN
Keep only rows with a match on both sides; rows without a counterpart disappear. It's the default join people reach for, and the one that quietly deletes rows when the foreign-key relationship isn't as tight as assumed.
Syntax #
sql
SELECT a.id, b.value_col
FROM a
INNER JOIN b ON a.key = b.key;Example #
Loading SQL editor...
Warning
Silent row loss. If some orders.user_id values don't exist in users (bad data, soft-deleted users, a users snapshot that's behind the orders snapshot), those rows vanish from the result with no warning. Always sanity-check the row count before and after an INNER JOIN on production data.