Excuse me, is there any SQL that can directly sort the current table by score, and then update a field in the top ten?
过去多啦不再A梦2017-05-19 10:09:15
That is, the IN/ALL/ANY/SOME subquery using the LIMIT clause is not supported, as long as you add another layer, such as:
UPDATE table SET name='zhangsan' WHERE id IN
(SELECT t.id FROM (SELECT id FROM table LIMIT 10) AS t)
phpcn_u15822017-05-19 10:09:15
update table set name='zhangsan' where id in (
select id from table order by sorce desc limit 10
)
//可以做到,子查询就完事