I have selected a group of rows
using Select statement in SQL
, and I'm trying to figure out how to update a column in this table
to a value based on said selection
.
The Selection:
SELECT user.userID FROM user WHERE user.status = '1' or user.status = '2' LIMIT 1000 OFFSET 50;
The Update:
UPDATE user SET user.status = '3';
The end result I am looking for is the status column
of all the selected users
be updated to '3'. I want to be able to do this in one SQL query
and not have to loop or anything.
Thanks for any insight!
UPDATE:
Sorry! I forgot to add the offset
. I want to select the rows after the first 50 returned rows.
So I want all the rows after the first 50 that match the criteria, to have the status column changed to 3.