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
288 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 100 total points
ID: 37725892
There is no difference.
0
 
LVL 53

Assisted Solution

by:Huseyin KAHRAMAN
Huseyin KAHRAMAN earned 100 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 200 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 100 total points
ID: 37726257
These are the same
0
 

Author Closing Comment

by:tommym121
ID: 37729740
Thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.

740 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