Write a query in SQL to list the name, salary, and commission for those employees whose net pay is greater than or equal to the salary of any other employee in the company
- برمجة سي كيو ال sql
- 2021-09-07
- mhanasmh00489829403
الأجوبة
SELECT e.emp_name,
e.salary,
e.commission
FROM employees e
WHERE
(SELECT max(salary+commission)
FROM employees) >= ANY
(SELECT salary
FROM employees);SELECT e.emp_name,
e.salary,
e.commission
FROM employees e
WHERE
(SELECT max(salary+commission)
FROM employees) >= ANY
(SELECT salary
FROM employees);
Sample Output:
emp_name | salary | commission ----------+---------+------------ KAYLING | 6000.00 | BLAZE | 2750.00 | CLARE | 2550.00 | JONAS | 2957.00 | SCARLET | 3100.00 | FRANK | 3100.00 | SANDRINE | 900.00 | ADELYN | 1700.00 | 400.00 WADE | 1350.00 | 600.00 MADDEN | 1350.00 | 1500.00 TUCKER | 1600.00 | 0.00 ADNRES | 1200.00 | JULIUS | 1050.00 | MARKER | 1400.00 | (14 rows)
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال