![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据库
zhener111
这个作者很懒,什么都没留下…
展开
-
一个表的数据复制到另一个表的sql写法
假设我们需要将表1的数据复制到表2 那么可以有两种写法: 1.insert into 表2(字段1,字段2) select 字段1,字段2 from 表1 这种情况,要求表2是必须存在的 2.select 字段1,字段2 into 表2 from 表1 这种写法,要求表2不存在...原创 2015-06-27 17:06:13 · 142 阅读 · 0 评论 -
把一个表的某个字段值改写到另外一张表的某个字段
假设表table1的字段name,需要跟表table2的字段name值同步,那么可以这样写sql语句 update table1 set name=a.name from table2 a where a.id=table1.id原创 2015-06-27 17:12:43 · 913 阅读 · 0 评论