Join Two columns of different tables

  • got one table named package and another table named Product.

    I want to join packageid column in package table and softwarename in product table. Not a single column is matched in both the table. Both tables are entirely different.

    Can any one help me with the query for that.

  • Buddy, this cant be done, unless you provide the Schemas of the tables, some sample data , a refined question and clear-cut desired results. Then, i promise you, there are lot of volunteers who will give you the best possible code to achieve that.

    On a side note, when those 2 tables dont even have a matching column, then they are no relatives! When they are no relatives , a relational database management system like SQL Server 2008 dont allow marriages between them :-D! So as far as i know, it cant be done. But hey, give us what i asked, then we may give you what u what!!

    Cheers!

  • By definition you aren't going to be doing a join. How do you know valid combinations? Without any matching columns you are looking at a cartesian product.

    CEWII

  • The whole idea of relational data storage is that there is something to relate one entity to another. No relation, no join. Something makes you think that there is a link between these two pieces of data. What is that link?

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • You could rownumber both tables and join on that. As others have hinted at though, there's not much sense in doing so. Please describe your goals with this.

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply