O'Reilly logo

SQL: Visual QuickStart Guide by Chris Fehily

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating Joins with JOIN or WHERE

You have two alternative ways of specifying a join: by using JOIN syntax or WHERE syntax. The ANSI SQL-92 standard prescribes JOIN syntax, but older SQL standards prescribe WHERE; hence, both JOIN and WHERE syntax are legal in most DBMSes.

Both types of syntax are used widely, so I’ll give examples that show how to implement equivalent JOIN and WHERE queries. JOIN queries will be in the main text, and the equivalent WHERE queries will be in the Tips.

In this section, I’ll show you the general syntax for JOIN and WHERE joins that involve two tables. The actual syntax that you’ll use in real queries will vary by the join type, the number of columns joined, the number of tables joined, and the syntax requirements ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required