在数据库中将所有成员分组(group)分为1-4组
楼上的uopdate如果不可以用那么还有一种方法。
其实可以把数据回插一下例如:
-- 备份全表数据
create table select * from table_A ;
-- 将不等于1的的数据插入到B表
create table table_B
select * from table_A
WHERE group != 1;
-- 实现update的操作
insert into table_B
select 100 l_r
,剩余各种字段····
from table_A
where group = 1;
-- 把表名改个名字
alter table table_a rename to table_bak;
alter table table_B rename to table_a;
直接调用sql语句更新就好了
update table set l_r='100' where group='1'
group是mysql的关键字,不能直接使用,需要加上反引号
update `table_name` set `l_r`=100 where `group`=1