What SQL query will help me to concatenate two different tables with different numbers of rows? For example, I have one table with column1 and column2 and three rows, and second table with column3 and column4 and five rows. How can I make a third table with column1, column2, column3 and column4 and five rows in it (so that the last two rows, column1 and column2, are empty)?

    Requires Free Membership to View

The simple answer to this question is: you can't do this with SQL.

Copy and paste your data into Excel. Then find a way to import the Excel sheet into your new table. Relational databases are, fundamentally, about the relationships between data. Your data isn't related—or, if it is, you failed to describe how.

This was first published in November 2008

Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.