How would I globally add +1 to a table in mysql?

56 views Asked by At

There was a problem with an sql server and my voting system set back people 1 day. I want to make it up to them and give them 1 point increase to make up for the loss.

How would I go about doing that? I was thinking of this but I don't think it would work..

SELECT votepoints FROM vsystem where votepoints=votepoints+1
4

There are 4 answers

1
Adonais On BEST ANSWER

No. What you are saying is like search where the result equals the result plus 1. That won't be true.

You can UPDATE your table:

update vsystem set votepoints = votepoints + 1

...or get the results + 1 (without modifying the table):

select (votepoints + 1) as voteplus from vsystem
0
ts. On

UPDATE vsystem SET votepoints=votepoints+1

0
Jordan Running On

If you want to do a one-time fix, just do:

UPDATE vsystem
SET votepoints = votepoints + 1

This will add 1 to the votepoints column for every row in the vsystem table.

0
FatherStorm On

UPDATE vsystem SET votepoints=votepoints+1;