SQL INNER JOIN vs LEFT JOIN: When Rows Disappear
By Sharon Ben-Moshe · August 16, 2026 · 1 min read
Sharon Ben-Moshe is the founder of sqlfmt, a browser-based SQL formatter and validator with misspelled-keyword suggestions across PostgreSQL, MySQL, SQLite, SQL Server, and BigQuery.
INNER JOIN keeps matches; LEFT JOIN also retains unmatched left rows. See the result difference, the WHERE-clause trap, and safe examples.
Quick answer
INNER JOIN returns only rows with a match on both sides of the join condition. LEFT JOIN returns every row from the left table and fills right-table columns with NULL when no match exists. Choose based on whether unmatched left-side records must remain visible.
Keep reading
BigQuery QUALIFY Clause: Filter Window Functions Directly
By Sharon Ben-Moshe · Aug 16, 2026
Use BigQuery QUALIFY to filter window-function results without an outer subquery. Learn evaluation order, top-N-per-group patterns, and portability.
Read postSQL Window Functions vs GROUP BY: Keep Detail Rows
By Sharon Ben-Moshe · Aug 16, 2026
GROUP BY collapses rows; window functions retain detail and add calculations beside it. See when each approach fits, with clear SQL examples.
Read postTry it now
Paste your SQL into sqlfmt — format, validate, and catch typos free in your browser.