sql 修改表字段时会出现表字段有值 我们可以这么做
2012-08-25 11:34
288 查看
create table <new_table > as select * from <old_table>; truncate table <old_table>; /* 有什么约束吗?*/ alter table <old_table> modify <column> ???; insert into <old_table> select * from <new_table >; 1。表结构相同的表,且在同一数据库(如,table1,table2) Sql :insert into table1 select * from table2 (完全复制) insert into table1 select distinct * from table2(不复制重复纪录) insert into table1 select top 5 * from table2 (前五条纪录) 2。 不在同一数据库中(如,db1 table1,db2 table2) sql: insert into db1..table1 select * from db2..table2 (完全复制) insert into db1..table1 select distinct * from db2table2(不复制重复纪录) insert into tdb1..able1 select top 5 * from db2table2 (前五条纪录) |
相关文章推荐
- 用SQL语句添加删除修改字段、一些表与字段的基本操作、数据库备份等,需要的朋友可以参考下。
- 用SQL语句添加删除修改字段、一些表与字段的基本操作、数据库备份等,需要的朋友可以参考下。
- Oracle复制某一个字段 批量修改(我们可以在插入的时候修改)
- SQL 查询分析器操作(修改、添加、删除)表及字段等
- Oracle/SQL 修改字段类型和长度
- SQL修改字段默认值
- SQL语句紫ACCESS添加字段、修改字段、删除字段
- SQL语句增删改字段、表、修改默认值
- Oracle中修改某个字段可以为空
- sql 语句操作,修改字段中字符串的一部分
- 用SQL语句添加删除修改字段
- SQL:Join 原来还可以这么用
- SQL修改字段默认值
- PL/SQL那点事-->修改Oracle数据库里面的字段长度
- 修改字段默认值的SQL语句怎么写?
- 用sql命令修改数据表中的一个字段为非空(not null)的语句
- clob大字段jdbc直连(怎么连都可以,这里写的是直连的方法),新增和修改时不乱码的处理
- 使用类的静态字段和构造函数,我们可以跟踪某个类所创建对象的个数。请写一个类,在任何时候都可以向它查询“你已经创建了多少个对象?”。
- SQL语句增加字段、修改字段、修改类型、修改默认值
- access数据库用sql语句添加字段,修改字段,删除字段