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

Nested case

P: 2
Is nested case allowed in DB2?

If so can u please tell me the syntax for that?
Aug 10 '07 #1
Share this Question
Share on Google+
1 Reply


P: 14
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.