Jump to content
  • 0

How can I reduce 1 from a value in SQL?


Fratini

Question


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  153
  • Reputation:   8
  • Joined:  07/01/14
  • Last Seen:  

Hi!

I'm thinking of reduce 1 from a value in SQL. For example:

 

I have a value called 'zeny' from a table called 'debt', which has 300,000.

I want to reduce 1 from that value, which goes to 299,999.

 

How can I make that in a sample way?

 

Thank you for your time!

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  666
  • Reputation:   674
  • Joined:  11/12/12
  • Last Seen:  

You could use the following:

UPDATE `debt` SET `zeny` = `zeny` - 1 WHERE `zeny` > 0
  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...