大神进 当字段第一行数据状态为1其他数据状态自动改为0怎么写
sql吧
全部回复
仅看楼主
level 1
Happyboy90后
楼主
当第一行数据状态为1 第二行往后其他数据自动改为0 大神怎么写
2018年01月04日 03点01分
1
level 1
Happyboy90后
楼主
自顶
2018年01月04日 03点01分
2
level 1
Happyboy90后
楼主
没人类
2018年01月04日 03点01分
3
level 10
08074000
update table set mainstatu=0 where exists(select 1 from table where id=1 and mainstatu=1) and id<>1
2018年01月06日 06点01分
4
夜风琳琅
谢谢
2018年07月09日 02点07分
level 1
夜风琳琅
谢谢
2018年07月09日 02点07分
5
1