468,257 Members | 1,409 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Nested case in DB2

Hi all,

I would like to know does DB2 supports nested case statement?

If it supports then can u please tell me the syntax?
Aug 10 '07 #1
2 17111
Hi all,

I would like to know does DB2 supports nested case statement?

If it supports then can u please tell me the syntax?

HI

Yes Db2 supports nested case statement. i am sending u a Update query
via 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
Purple
404 Expert 256MB
Moved from Articles

Moderator
Aug 15 '07 #3

Post your reply

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

Similar topics

8 posts views Thread by BobTheDatabaseBoy | last post: by
5 posts views Thread by cbielins | last post: by
1 post views Thread by rumana shaik | 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
reply views Thread by NPC403 | last post: by
reply views Thread by kermitthefrogpy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.