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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Difference Between Using and NOT using a JOIN

Status
Not open for further replies.

Creeder

Programmer
Jul 5, 2000
110
MY
Hi all,

Let's say if i want to select some fields from 2 table i do something like

SELECT cust.cust_id,
name.first_name
FROM Customer As Cust,
JOIN detail As Name ON cust.cust_id = name.cust_id

OR i can do

SELECT cust.cust_id,
name.first_name
FROM Customer AS cust,
Detail AS Name
WHERE cust.cust_id = name.cust_id

which will yield the same result. However the second SQL statment does not have a JOIN. Is there a difference? Which is better for performance?

Thanks in advance

Yue Jeen

 
You could see the thread I started on 10/10/00 called join information. I know that I found the answers posted quite helpful.

Crystal
crystals@genesis.sk.ca

--------------------------------------------------

Experience is one thing you can't get for nothing.

-Oscar Wilde

 
In a nutshell, there shouldn't be a performance difference in SQLS7. The JOIN syntax is ANSI SQL92 compatible; many think it is also cleaner/easier to read.

Robert Bradley

 
In addition, you should use the ANSI standard way of doing the join because there are certain cases where you will get more rows than you should when you use outer joins (*= is a left outer join, for example) and you are dealing with NULL values.

Use the ANSI compliant form of SQL and:
(1) it will always work properly
(2) it will port more easily

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top