目標:只顯示員工和他們的薪水,至少像 2100。
我如何在我的查詢中放置條件,薪水應該是 = 2100?
詢問:
SELECT e.first_name ||' with the salary of '|| d.salary
AS Employees_and_their_Salary
FROM hr.employees e
JOIN hr.employees d
ON e.manager_id = d.employee_id;
我想要的輸出應該是這樣的:

我使用的資料庫是LiveSQL的Oracle HR Objects and Data
uj5u.com熱心網友回復:
你只需要添加一個 where 條件 -
SELECT e.first_name ||' with the salary of '|| d.salary
AS Employees_and_their_Salary
FROM hr.employees e
JOIN hr.employees d ON e.manager_id = d.employee_id
WHERE d.salary = 2100;
uj5u.com熱心網友回復:
嗯……你為什么要自己加入那張桌子?您想要的輸出并不表明您需要它。簡單有什么問題
SELECT e.first_name ||' with the salary of '|| e.salary AS Employees_and_their_Salary
FROM hr.employees e
WHERE e.salary = 2100;
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/368561.html
