-
is there a way to do this with a case statement?
update #totals
set cutoff = '3:00pm'
where id in (14,15)
update #totals
set cutoff = '1:00pm'
where id in (16)
update #totals
set cutoff = '12:00pm'
where id in (17,18,19,20)
update #totals
set cutoff = '9:00am'
where id in (21)
update #totals
set cutoff = '2:40pm'
where id in (22)
-
Yes (MS SQL Server 7.0):
UPDATE #totals set cutoff =
CASE id
when 14 then '3:00pm'
when 15 then '3:00pm'
when 16 then '1:00pm
...
END
That's it!
Roger
-
case is available in SQL Server 6.5 too!