Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

update query feasible solution

 
rama rajesh
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My Requirement is updating the emp table, sal column

if sal>=2000 and <3000 add 2000
if sal>=3000 and <4000 add 3000
if sal>=4000 and <5000 add 5000

you can do this in many ways.but what is the feasible solution?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34178
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How many ranges do you have? If just the thre, I would use three update statements? If a lot, I would use a stored procedure.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic