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 |
basicconfiguration
Constraint Violating Yak Guru
358 Posts |
Posted - 2012-09-28 : 13:45:54
|
declare @computer table (computerid int, computermodel varchar(20))declare @user table (userid int, computerid int)insert @computer select 1, 'xx' union allselect 1, 'yy' union allselect 1, 'zz' insert @userselect 1, 1 union allselect 2, 2select c.computerid, c.computermodel, u.userid from @computer cjoin @user u on u.computerid = c.computeridselect c.computerid, c.computermodel, u.userid from @computer cjoin @user u on c.computerid = u.computeridgetting a little bit curious about how to use the columns when using a join. I dont know which columns to use first to gain the best performance when doing a join.I checked the execution plan and both gives me the same execution plan. therefore, I think it doesn't matter the order of the columns in the join. Am i right? |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|