Join Two CSV Files
Merge two CSV files on a shared column with a SQL join in your browser. Inner, left and full joins, find unmatched rows, then download the joined CSV.
Combining two CSV files by a shared ID — orders with customers, sales with prices — is one of the most common data chores. In the SQL Playground both files become tables and a single JOIN does the work, including telling you which rows didn't match.
How it works
- Drop both CSV files into the SQL Playground.
- Write a JOIN on the shared column (for example customer_id).
- Run it and export the joined result as CSV.
Examples you can copy
Add details from a second file (left join)
SELECT o.*, c.name, c.segment
FROM orders o
LEFT JOIN customers c USING (customer_id);
Rows with no match in the other file
SELECT o.*
FROM orders o
ANTI JOIN customers c USING (customer_id);
Keep only rows found in both
SELECT o.order_id, c.name
FROM orders o
JOIN customers c USING (customer_id);
FAQ
How do I merge two CSV files by a common column?
Load both files, then use JOIN ... USING (column) or JOIN ... ON a.col = b.col. A LEFT JOIN keeps every row from the first file and adds matching details from the second.
How do I find rows that don't match?
Use an ANTI JOIN, or a LEFT JOIN and filter WHERE the second file's column IS NULL.
What if the column names differ?
Use ON instead of USING, for example ON o.cust = c.customer_id.
Is there a no-code way?
Yes. The Data Merge tool joins two files with point-and-click options.
Open the SQL Playground
Explore the local data workbench · Browse all tools