If you really must do it this way, you can use something like this:
UPDATE messages SET test_read=1
WHERE id IN (
SELECT id FROM (
SELECT id FROM messages
ORDER BY date_added DESC
LIMIT 5, 5
) tmp
);
More Related Contents:
- MySQL, update multiple tables with one query
- UPDATE multiple rows with different values in one query in MySQL
- Multiple Updates in MySQL
- mysql update column with value from another table
- MySQL/SQL: Update with correlated subquery from the updated table itself
- What are differences between INSERT and UPDATE in MySQL?
- MySql – Way to update portion of a string?
- MySQL UPDATE syntax with multiple tables using WHERE clause
- The best way to remove value from SET field?
- Update MySQL with if condition
- Update multiple rows with multiple ‘where’ clauses for each individual row
- MySQL update statement to store ranking positions
- Using LIMIT within GROUP BY to get N results per group?
- How to perform grouped ranking in MySQL
- MySQL Trigger after update only if row has changed
- MySQL “WITH” clause
- Ordering by specific field value first
- MySQL “Group By” and “Order By”
- How to change the CHARACTER SET (and COLLATION) throughout a database?
- MySQL Query to select data from last week?
- Mysql 1050 Error “Table already exists” when in fact, it does not
- MySQL “IN” operator performance on (large?) number of values
- How to get the latest record in each group using GROUP BY? [duplicate]
- Advanced MySql Query: Update table with info from another table
- How do I count columns of a table
- Difference between two table structure
- Difference between SET autocommit=1 and START TRANSACTION in mysql (Have I missed something?)
- MySQL equivalent of Oracle’s SEQUENCE.NEXTVAL
- Why MySQL is giving error “Not allowed to return a result set from a function”?
- When to use a left outer join?