mult joins

  • Can you join a table to multiple columns?

  • Yes.

  • Q. Can you use a table to join multiple columns?

    Yes, Using Aliases.

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

  • 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

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • 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.

  • ...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:

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • 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