Set Operator Sample. SELECT employee_id, department_id FROM employee_id WHERE (employee_id, department_id) IN(SELECT employee_id, department_id FROM employees {UNION|UNION ALL|INTERSECT|MINUS} SELECT employee_id, department_id FROM job_history); Oracle 2006.09.01
SUM + DECODE + TO_CHAR SELECT COUNT(*) total, SUM(DECODE(TO_CHAR(hire_date, 'YYYY'),1995,1,0))"1995", SUM(DECODE(TO_CHAR(hire_date, 'YYYY'),1996,1,0))"1996", SUM(DECODE(TO_CHAR(hire_date, 'YYYY'),1997,1,0))"1997", SUM(DECODE(TO_CHAR(hire_date, 'YYYY'),1998,1,0))"1998" FROM employees; Make it sure that you will check this question again!!!! This sql statement is very similar with the previous one. select job_id as "Job.. Oracle 2006.08.31
SUM + DECODE + TO_CHAR SELECT COUNT(*) total, SUM(DECODE(TO_CHAR(hire_date, 'YYYY'),1995,1,0))"1995", SUM(DECODE(TO_CHAR(hire_date, 'YYYY'),1996,1,0))"1996", SUM(DECODE(TO_CHAR(hire_date, 'YYYY'),1997,1,0))"1997", SUM(DECODE(TO_CHAR(hire_date, 'YYYY'),1998,1,0))"1998" FROM employees; Make it sure that you will check this question again!!!! This sql statement is very similar with the previous one. select job_id as "Job.. Oracle 2006.08.31