Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
kt
Yak Posting Veteran
88 Posts |
Posted - 2013-05-01 : 10:10:28
|
I am query inner join with mutiple tables and only want to query out the code BCF from b table. Both queries below give me the same results, but i am not sure which one is the the correct and help with performace issue.Query # 1select a.date_delivery, a.desc, b.puNo, c.itemfrom sale_order ainner join purchase bon a.saleNo = b.saleNoinner join itemMs con c.item = b.itemwhere b.CodeNo = 'BCF'Query # 2select a.date_delivery, a.desc, b.puNo, c.itemfrom sale_order ainner join purchase bon a.saleNo = b.saleNo and b.CodeNo = 'BCF'inner join itemMs con c.item = b.itemthank you, |
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2013-05-01 : 10:42:59
|
Shouldn't make a difference - both are correct and you can use either, given that you are using INNER JOINS. Both should generate the same query plans as well. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-05-02 : 01:14:02
|
the difference will only come into play for OUTER JOINS------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
|
|
|