Solved

Join question

Posted on 2003-11-15
1
452 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
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

Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Can I skip a node in XML? 9 35
Searching a barcode number within a string. 7 27
SQL Instance service gone? 5 38
Trouble installing msi file with msiexe.exe 2 18
Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
I have a large data set and a SSIS package. How can I load this file in multi threading?
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
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…

733 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