Can anyone tell me what is wrong with this query below?
from a programming point of view it makes perfect sense but sql does not seem to like it.
SELECT SNAME, YEAR, GPA FROM STUDENT
WHERE (YEAR >= 5 AND GPA <=3.0) AND (WHERE YEAR <=4 AND GPA <= 2.0)
ORDER BY YEAR, GPA DESC ;
I get this error:
Error at line 2
ORA-00936: missing expression
The problem is you are having two
WHEREclauses in your query.Also you should be combining the two boolean expressions using an
ORoperator rather than anAND, so that the complete expression is true when either of the two is satisfied: