Open main menu

CDOT Wiki β

Changes

J.Y.S

471 bytes added, 21:13, 19 October 2010
4.
''Saad''
<pre>
SELECT SUBSTR(first_name||' '||last_name, 25) Employee, job_id,
LPAD(TO_CHAR(salary,'$999,999'), 12, '=') Salary, department_name
FROM employees e JOIN departments d
USING (department_id)
WHERE salary < (SELECT MAX(salary)
FROM employees
WHERE UPPER(SUBSTR(job_id,4)) NOT IN ('VP', 'PRES', 'MAN', 'MGR')
)
AND UPPER(department_name) IN ('MARKETING','SALES')
ORDER BY first_name, last_name
/
</pre>
''James''
1
edit