I am trying to update a table (EWS) by using a case statement. I am able to run this select statement
but i cant figure out how I can do an update with it. Can you have a select statement with an update? Maybe with a begin? Not sure...Thanks
Code:
select A.EWS_ID, A.EWS_Level, b.Hours_hours_earned,
"NEW STUFF"
= CASE
When (b.Hours_hours_earned) Between 0 and 27.990 Then '01'
When (b.Hours_hours_earned) Between 28 and 57.990 Then '02'
When (b.Hours_hours_earned) Between 58 and 87.990 Then '03'
When (b.Hours_hours_earned) Between 88 and 999 Then '04'
Else 'Something'
End
from EWS A, Hours b
where a.EWS_ID = b.Hours_ID
and EWS_Level = '10'
but i cant figure out how I can do an update with it. Can you have a select statement with an update? Maybe with a begin? Not sure...Thanks