?
Solved

SQL - Join table a and table b on a.code = b.code Vs from table a, table b where a.code = b.code

Posted on 2012-03-15
5
Medium Priority
?
291 Views
Last Modified: 2012-06-27
I am trying to understand the difference between Join table a and table b on a.code = b.code Vs from table a, table b where a.code = b.code.
Is there any difference or when will they be different?

I am using SQL Server 2008 R2
0
Comment
Question by:tommym121
[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
5 Comments
 
LVL 29

Assisted Solution

by:Paul Jackson
Paul Jackson earned 400 total points
ID: 37725892
There is no difference.
0
 
LVL 57

Assisted Solution

by:HainKurt
HainKurt earned 400 total points
ID: 37726139
there is difference :)

select * from Join mytable1 a and mytable2 b on a.code = b.code

above is not correct syntax, gives error

select * from mytable1 a, mytable2 b where a.code = b.code

above is correct...

select * from mytable1 a inner join mytable2 b on a.code = b.code

above is also correct and same as the other one...
0
 
LVL 75

Assisted Solution

by:Anthony Perkins
Anthony Perkins earned 800 total points
ID: 37726163
If that is all it is, then the QO in SQL Server is smart enough to recognize the old syntax as a JOIN.  However, I would encourage you to start using the newer syntax, it is only a question of time before it is no longer supported.  There are also some edge cases where I have seen that mixing the syntax produces bad performance.
0
 

Accepted Solution

by:
gnetgnet earned 400 total points
ID: 37726257
These are the same
0
 

Author Closing Comment

by:tommym121
ID: 37729740
Thanks
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
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

777 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