I want to run two Oracle SQL queries together inside TOAD.
first query:
SELECT * FROM OT_SO_HEAD WHERE SOH_ANNOTATION = 'ECSO10012791'
and second:
SELECT * FROM OT_SO_ITEM WHERE SOI_SOH_SYS_ID = '30977853'
Please guide
CodePudding user response:
You can use UNION
or UNION ALL
.
The UNION
operator is used to combine the result-set of two or more SELECT statements.
Every SELECT statement within
UNION
must have the same number of columnsThe columns must also have similar data types
The columns in every SELECT statement must also be in the same order
Syntax:
SELECT column_name(s) FROM table1
UNION
SELECT column_name(s) FROM table2;
The UNION
operator selects only distinct values by default. To allow duplicate values, use UNION ALL
.
CodePudding user response:
right click in script window and select EXECUTE -> Execute via Toad Script Runner and reuse Toad