题目链接:点击打开链接
题目大意:略。
解题思路:略。
AC 代码
WITH t AS(SELECT company_id, CASE WHEN MAX(salary) < 1000 THEN 0 WHEN MAX(salary) BETWEEN 1000 AND 10000 THEN 0.24 WHEN MAX(salary) > 10000 THEN 0.49 END tax_rate FROM Salaries GROUP BY company_id) SELECT company_id, employee_id, employee_name, ROUND(salary * (1 - tax_rate), 0) salary FROM Salaries JOIN t USING(company_id)