|
basicconfiguration
Constraint Violating Yak Guru
350 Posts |
Posted - 09/28/2012 : 13:45:54
|
declare @computer table (computerid int, computermodel varchar(20))
declare @user table (userid int, computerid int)
insert @computer select 1, 'xx' union all select 1, 'yy' union all select 1, 'zz'
insert @user select 1, 1 union all select 2, 2
select c.computerid, c.computermodel, u.userid from @computer c join @user u on u.computerid = c.computerid
select c.computerid, c.computermodel, u.userid from @computer c join @user u on c.computerid = u.computerid
getting 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? |
|