How to combine 2 select statements in oracle?

Member

by daisha , in category: MySQL , 4 months ago

How to combine 2 select statements in oracle?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by raphael_tillman , 4 months ago

@daisha 

To combine two select statements in Oracle, you can use the UNION operator. Here is an example of how to combine two select statements using UNION:


SELECT column1, column2 FROM table1 WHERE condition1 UNION SELECT column1, column2 FROM table2 WHERE condition2;


In this example, we first select columns from table1 based on a certain condition and then combine the results with the columns selected from table2 based on another condition using the UNION operator. This will return a single result set with the combined data from both select statements.