Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Difference in InnerJoin and simple Query

Status
Not open for further replies.

ashark

Programmer
Nov 21, 2002
31
0
0
IN
Hi Group,
What is the difference in the following queries :
use pubs
select t.title, p.pub_name
from publishers as p inner join titles as t
on p.pub_id = t.pub_id
Order by title asc

use pubs
select t.title, p.pub_name
from publishers as p ,titles as t
where p.pub_id = t.pub_id
Order by title asc


Both these queries returnt the same result...

Please help...

 
It is only a syntactical difference, otherwise they are equivalent.
 
this is the preferred one as Microsoft may not continue to support the non-Ansi version.

use pubs
select t.title, p.pub_name
from publishers as p inner join titles as t
on p.pub_id = t.pub_id
Order by title asc

 
You are mistaken.

Code:
select t.title, p.pub_name
from publishers as p ,titles as t
where p.pub_id = t.pub_id
Order by title asc

is ANSI compliant. Microsoft has newer said anything about not supporting this in the future. What they say is that the SQL Server specific syntax for outer join, i.e.

Code:
select t.title, p.pub_name
from publishers as p ,titles as t
where p.pub_id *= t.pub_id
Order by title asc

may not be supported in future releases.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top