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

Comments

  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.

    ReplyDelete
  2. Fantastic 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!

    ReplyDelete
  3. Hello, 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

Post a Comment

Popular posts from this blog

Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=xx.0.0.0, Culture=neutral, PublicKeyToken='xxx' or one of its dependencies.

C# Crop white space from around the image

The specified version string contains wildcards, which are not compatible with determinism.