How to make changes as per id?


Can someone tell me the SQL Command to make changes to a certain number of entries.
For example If I have 2 columns in a table namely, id & status.

Now if I want to change status=1 on records from id=1 to 10,

How to do this?

MySQL :: MySQL 5.5 Reference Manual :: 12.2.11 UPDATE Syntax

Thank you sir.

Hi I tried it, but it’s not working.

SET status=‘1’
[WHERE ‘id’>1 AND ‘id’<10]

remove the square brackets, which are used in the syntax in the manual to show words or clauses that are optional

also, don’t put single quotes around your column names, that just turns them into strings

also, don’t put quotes around numeric values that will be compared with or assigned to numeric columns – it’ll work in mysql (but not in other databases), but the conversion from string to number is needless overhead

UPDATE table_name
   SET status = 1
 WHERE id > 1 
   AND id < 10

Thank you Rudy Sir.