Solved

Join question

Posted on 2003-11-15
1
458 Views
Last Modified: 2008-03-06
Hello,

Is there any difference between these two select commands?

(from the sample 'Pubs' database in MS SQL Server 2000)

----------------------------------------------------------
select T.title, P.pub_name
from titles T
   join publishers P on (T.pub_id = P.pub_id);
-----------------------------------------------------------
select T.title, P.pub_name
from titles T, publishers P
where (T.pub_id = P.pub_id);
----------------------------------------------------------

I know that they return the same records.

But I learned in my Oracle classes (in college) to do joins like the second select.
And now I am reading a MS SQL Server book that teaches joins like in the first select.

So.....
Is there a "better" way, or it's just a matter of personal taste?

Thanks in advance.


0
Comment
Question by:LeoHyppolito
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 4

Accepted Solution

by:
krznpsk earned 50 total points
ID: 9755184
That's because Oracle didn't support the JOIN keyword until version 9i.

MS SQL is compliant either way you type it, but the JOIN syntax is recommended.  One reason is that you can qualify the JOIN type, as in INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL OUTER JOIN, and CROSS JOIN.

INNER JOIN is the default, and using only the JOIN keyword will perform an INNER JOIN.
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have a large data set and a SSIS package. How can I load this file in multi threading?
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question