PDA

View Full Version : MySQL query help


Llamaman
05-22-2005, 09:40 AM
I'm not an expert with MySQL queries so if anyone could tell me if this is possible then I would be greatful.

I would like to create a query that subtracts 150 from a MySQL table field's data.

For example, I have a field in the VBulletin members table named "points". I would like to subtracting 150 "points" from each user. Is there a query that I can run to reduce every user's points by 150?

Thanks.

Shaved
05-22-2005, 12:01 PM
I'm not an expert with MySQL queries so if anyone could tell me if this is possible then I would be greatful.

I would like to create a query that subtracts 150 from a MySQL table field's data.

For example, I have a field in the VBulletin members table named "points". I would like to subtracting 150 "points" from each user. Is there a query that I can run to reduce every user's points by 150?

Thanks.
UPDATE user SET points = points-150 WHERE points != 0

I guess that would work assuming that when you say members table you actually meant user table

Llamaman
05-22-2005, 07:35 PM
Yes that worked perfectly. Thank you Shaved.