467,154 Members | 962 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,154 developers. It's quick & easy.

Nested case

Is nested case allowed in DB2?

If so can u please tell me the syntax for that?
Aug 10 '07 #1
  • viewed: 1703
Share:
1 Reply
Is nested case allowed in DB2?

If so can u please tell me the syntax for that?



yes it is allowed.....
i am sending u a update statement with nested case.

UPDATE STAFF
SET COMM = CASE DEPT
WHEN 15 THEN COMM * 1.1
WHEN 20 THEN COMM * 1.2
WHEN 38 THEN
CASE
WHEN YEARS < 5 THEN COMM * 1.3
WHEN YEARS >= 5 THEN COMM * 1.4
ELSE NULL
END
ELSE COMM
END
WHERE COMM IS NOT NULL
AND DEPT < 50;
Aug 14 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Tcs | last post: by
8 posts views Thread by Robert W. | last post: by
37 posts views Thread by Tim N. van der Leeuw | last post: by
3 posts views Thread by Frank Swarbrick | last post: by
4 posts views Thread by Wolfgang Draxinger | last post: by
5 posts views Thread by Calvin Spealman | last post: by
3 posts views Thread by Cousson, Benoit | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.