1.update id set (a,b,c)=(select a,b,c from ida where ida.id=id.id);
2.update id t1 set a=(select t2.a from ida t2 where t1.id=t2.id),b=(select t2.b from ida t2 where t1.id=t2.id),c=(select t2.c from ida t2 where t1.id=t2.id)
本文介绍了两种使用SQL进行数据更新的方法:一种是通过子查询一次性更新多个字段;另一种是针对每个字段分别进行更新。这两种方法均可用于从另一个表中选择数据来更新当前表的数据。
1.update id set (a,b,c)=(select a,b,c from ida where ida.id=id.id);
2.update id t1 set a=(select t2.a from ida t2 where t1.id=t2.id),b=(select t2.b from ida t2 where t1.id=t2.id),c=(select t2.c from ida t2 where t1.id=t2.id)
您可能感兴趣的与本文相关的镜像
Stable-Diffusion-3.5
Stable Diffusion 3.5 (SD 3.5) 是由 Stability AI 推出的新一代文本到图像生成模型,相比 3.0 版本,它提升了图像质量、运行速度和硬件效率
3176

被折叠的 条评论
为什么被折叠?