Lukas Eder has a comprehensive guide to joining data using SQL:
Alternative syntaxes: NATURAL JOIN
An more extreme and much less useful form of
"EQUI" JOINis theNATURAL JOINclause. The previous example could be further “improved” by replacingUSINGbyNATURAL JOINlike this:SELECT * FROM actor NATURAL JOIN film_actor NATURAL JOIN filmNotice how we no longer need to specify any
JOINcriteria, because aNATURAL JOINwill automatically take all the columns that share the same name from both tables that it joins and place them in a “hidden”USINGclause. As we’ve seen before, as primary keys and foreign keys have the same column name, this appears quite useful.
There is a high likelihood that you will learn at least one new thing here; for example, check out lateral joins (which SQL Server practitioners know as something else).
Comments closed