Q

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 first published in November 2008

Dig deeper on Oracle development languages

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

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.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close