Using CASE Statements In A SQL UPDATE Query
user following CASE statement:
UPDATE [account]
SET
balance =
(
CASE
WHEN ((balance - 10.00) < 0)
THEN 0
ELSE (balance - 10.00)
END
)
WHERE
id = 1
I really like what you guys are up too. This sort of clever work and exposure! Keep up the awesome works guys I've included you guys to my own blogroll.
ReplyDeleteFantastic website. A lot of useful info here. I'm sending it to several buddies ans additionally sharing in delicious. And certainly, thank you to your sweat!
ReplyDeleteHello, i think that i saw you visited my web site thus i came to “return the favor”.I'm attempting to find things to enhance my web site!I suppose its ok to use some of your ideas!!
ReplyDelete