?
Solved

Join question

Posted on 2003-11-15
1
Medium Priority
?
464 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 200 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…
Suggested Courses

770 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