Home > database >  How to get the multiple SQL query statistics results displayed at a time
How to get the multiple SQL query statistics results displayed at a time

Time:09-24

I have three words of SQL, the query condition is different, now need to the three query results displayed at once, how to do?
Use of database is oracle

CodePudding user response:

If the field can use the union, if not consistent, can be used with the

CodePudding user response:

Add a semicolon behind each query, it is ok to run

CodePudding user response:

Union all
 select 1, 2 from dual 
Union all
Select 3, 4 from dual
Union all
Select 5 or 6 from dual;

CodePudding user response:

Using UNION and UNION ALL, both are multiple query result set together, forming a set of results, different formation of UNION ALL operation result set, but the result set contains two child

CodePudding user response:

The
reference 3 floor shpery response:
union all
 select 1, 2 from dual 
Union all
Select 3, 4 from dual
Union all
Select 5 or 6 from dual;
3 l positive solutions

CodePudding user response:

According to if you don't understand your question correctly, there are two
The first is that you want to put all the three kinds of result set inside a table then use the upstairs said union all
The second is that you want to put all the three kinds of result set different table there are three tabs that each statement you add a; Will do,
Select * from A
Union all
Select * from B
Union all
Select * from C
______________________________
Select * from A;
Select * from B;
Select * from C;

  • Related