SQL's NATURAL JOIN and JOIN USING syntax can introduce subtle bugs when schemas evolve. NATURAL JOIN joins on all shared column names, which is dangerous when audit columns like LAST_UPDATE exist across tables. JOIN USING is cleaner for ad-hoc queries but can break silently when new columns are added — for example, adding a column to one table can create ambiguity in a subsequent JOIN USING clause, causing errors in PostgreSQL and Oracle. The safe alternative for production queries is always JOIN ... ON with explicit table-qualified column references.

3m read timeFrom blog.jooq.org
Post cover image
Table of contents
JOIN USING to the rescue?Like this:

Sort: