Problem solve Get help with specific problems with your technologies, process and projects.

Can I concatenate row values in SQL?

An Oracle user asks SQL expert Rudy Limeback if there is an SQL query that will concatenate two different tables with different numbers of rows.

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)?
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 last published in November 2008

Dig Deeper on Oracle development languages

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.