By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,756 Members | 1,760 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,756 IT Pros & Developers. It's quick & easy.

Nested case in DB2

P: 2
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
Share this Question
Share on Google+
2 Replies


P: 14
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
Expert 100+
P: 404
Moved from Articles

Moderator
Aug 15 '07 #3

Post your reply

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