Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
zakeer
Starting Member
20 Posts |
Posted - 2008-03-31 : 13:33:43
|
| I have a table called emp 1 eno ename desg sal 1 aaa manager 20000 2 bbb executive 15000 3 ccc hr 25000 4 ddd ceo 45000using single update statement , how can i update the salary based on the desg .i have to give hike if its manager sal =sal+(sal*0.10) .like thisThanks & RegardsZakeer |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-03-31 : 13:36:25
|
| [code]UPDATE empSET sal=CASE WHEN desg='manager' THEN sal+(sal * 0.1) WHEN desg='executive' THEN... .... END[/code] |
 |
|
|
zakeer
Starting Member
20 Posts |
Posted - 2008-03-31 : 14:03:24
|
| THANKS ALOTThanks & RegardsZakeer |
 |
|
|
|
|
|