April 16, 2012 at 11:26 pm
Can you join a table to multiple columns?
April 16, 2012 at 11:37 pm
Yes.
April 17, 2012 at 12:08 am
April 17, 2012 at 4:14 am
l090475 (4/16/2012)
Can you join a table to multiple columns?
The correct answer to this question is: NO! You cannot join table to multiple columns!
More than that, you cannot joint table to single column as well. Simply: you cannot join table to columns!
You can only join table to table like objects (tables, views, table-value user defined functions etc.)
In one query, you can join table to one or multiple tables on one or multiple columns.
For example:
SELECT T1.Col1, T2.Col2, T3.Col3
FROM T1
JOIN T2
ON T2.KeyCol = T1.KeyCol
JOIN T3
ON T3.KeyCol1 = T1.KeyCol
AND T3.KeyCol2 = T1.Col1
April 17, 2012 at 7:12 am
Perhaps I took some latitude, but I was making the assumation (bad thing to do at times) that the OP was talking about joining tables together on multiple columns. Based on that assumation, my answer is still correct, yes.
April 17, 2012 at 7:51 am
...I was making the assumation (bad thing to do at times) that the OP was talking about joining tables together on multiple columns...
You never know for sure :hehe:
April 17, 2012 at 8:08 am
Eugene Elutin (4/17/2012)
...I was making the assumation (bad thing to do at times) that the OP was talking about joining tables together on multiple columns...
You never know for sure :hehe:
On ssc, it is usually worthwhile to make some assumptions. This is especially true when it is apparent that english is not the OPs first language. If an assumption is wrong, things can be corrected.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply