问题:mysql连表更新limit数据错误
UPDATE table_a SET col_name_1 = '固定值'
WHERE col_name_2 in (select col_name_1, col_name_2 from table_a LIMIT 6)
执行结果:This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery
解决方法:
mysql连表更新使用 inner join
update table_name a
inner join (select col_name_1 from table_name limit 6) b
on a.col_name_1 = b.col_name_1
set a.col_name_2 = '固定值'