Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
Any Oracle experts out there?
Okay. I'm doing my Oracle homework and I keep getting and error. I don't know what's wrong. I'm following the example. Does anyone know what's wrong?
SELECT department_id, last_name, salary
CASE department_id WHEN '10' THEN '1.25'*salary,
WHEN '90' THEN '1.5'*salary,
WHEN '130' THEN '1.75'*salary,
ELSE salary
END AS "New Salary"
FROM employees
The error I'm getting is:
FROM keyword not found where expected.
**PS. If this is in the wrong section... sorry. Not quite sure where it goes other than Homework Help**
2 Answers
- 1 decade agoFavorite Answer
You forgot to put a comma between salary and CASE.. also you can remove the qoutes from your multipliers(1.25,1.5,1.75).. so the query should read as follows
SELECT department_id, last_name, salary,
CASE department_id WHEN '10' THEN 1.25*salary,
WHEN '90' THEN 1.5*salary,
WHEN '130' THEN 1.75*salary,
ELSE salary
END AS "New Salary"
FROM employees