 |
|
SQL Server Tips by Burleson |
Inner join
An inner join has an ON clause that specifies the join conditions.
Rather than having a huge rowset in memory and filtering the data,
like in the previous example, this join extracts only the data that
meets the join conditions. The keyword INNER is optional because a
JOIN clause will be INNER by default. An inner join is called equi-join
when all the columns are selected with a *, or natural join
otherwise.
Example: To display publishers and their corresponding titles, but
only publishers that published at least one title. This is done by
selecting publishers with at least one title in the table titles and
titles with at least one publisher from table publishers, in other
words joining by the pub_id.
SELECT dbo.publishers.pub_name,
dbo.titles.title
FROM dbo.publishers INNER JOIN
dbo.titles ON dbo.publishers.pub_id = dbo.titles.pub_id
The above book excerpt is from:
Super SQL
Server Systems
Turbocharge Database Performance with C++ External Procedures
ISBN:
0-9761573-2-2
Joseph Gama, P. J. Naughter
http://www.rampant-books.com/book_2005_2_sql_server_external_procedures.htm |