Forum Stats

  • 3,853,801 Users
  • 2,264,276 Discussions
  • 7,905,450 Comments

Discussions

Multi columns

User_7FAON
User_7FAON Member Posts: 32 Red Ribbon

Select * from employees;

    AGE QUAL   INCOME

---------- ---- ----------

    19 Grad    5000

    19 Grad    4000

    19 Grad    3000

    26 Grad    6000

    26 Grad    5000

    26 PosG    8000


Question : I want to update the QUAL Column data of 19th AGE only.


Update employees set(AGE, INCOME) =

 Case

when AGE = 19 and Income = 5000 then QUAL= 'HTC'

 WHEN AGE = 19 and Income = 4000 then QUAL = 'MI'

 else

 QUAL = 'HP'

/


Case

*

ERROR at line 2:

ORA-01767: UPDATE ... SET expression must be a subquery




Can anyone help me in resolving this query.

Tagged:

Answers