tags:

views:

36

answers:

4

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
+3  A: 

UPDATE vsystem SET votepoints=votepoints+1

ts
+2  A: 

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.

Jordan
Thank you for the help:)
Kyle
+1  A: 

UPDATE vsystem SET votepoints=votepoints+1;

FatherStorm
+2  A: 

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
Neo Adonis
Ohh I see what I was doing wrong. Thanks a lot for pointing that out and making it clear. :)
Kyle