I have a table with several hundred rows. I want to take the top 20 based on the value of column num
and replace num
with a number.
What I tried to do (which didn't work) was:
UPDATE table
SET num = 95
WHERE id IN (SELECT id FROM table ORDER BY id DESC LIMIT 20)
Any suggestions?