Get the App
SLTechnology News&Howtos  ›  Database  › 

How to merge columns from multiple tables into one table in oracle

Shulou Source: shulou.com Published: 2022-05-31 23:49:20 10月23日 Update

This article is about how to merge the columns of multiple tables into one table in oracle, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

Solution

For testing convenience, we directly use the table emp and table dept under the scott user of the Oracle database

Table emp:

Select rownum as rn1, t. * from scott.emp t

Table dept:

Select rownum as rn2, t. * from scott.dept t

With an as (select rownum as rn1, t. * from scott.emp t), b as (select rownum as rn2, t. * from scott.dept t) select a. From a full join b on a.rn1, b. * from a full join b on a.rn1 = b.rn2

three。 Induction and summary

As you can see, we use full join (fully connected) to implement our needs.

3.1 basic grammar

Full join... On...

3.2 results

The query result of the full join is the union of the left outer join and the right outer join, even if some records are not related, the information can be queried.

The above is how to merge the columns from multiple tables into one table in oracle. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Tags: Lieutenant General multiple all-connected more knowledge articles results queries practicality information that is work meetings data databases articles solutions users look knowledge points industry Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB MySQL Docker Shulou Technology Huawei