| Using Union clause | ||||
|
Used to combine the results of two component queries into a single result. Queries containing set operators are called compound queries The corresponding expressions in the select lists of the component queries of a compound query must match in number and datatype. If component queries select character data, the datatype of the return values are determined as follows:
Example SELECT FIRST_NAME, LAST_NAME, JOB_ID, SALARY, HIRE_DATE START_DATE FROM EMPLOYEES WHERE EMPLOYEE_ID = (select EMPLOYEE_ID from EMPLOYEES where LAST_NAME = 'De Haan') UNION SELECT '','', JOB_ID, SALARY, START_DATE START_DATE FROM JOB_HISTORY WHERE EMPLOYEE_ID = (select EMPLOYEE_ID from EMPLOYEES where LAST_NAME = 'De Haan') ORDER BY START_DATE |
||||