学习oracle技术,每天学一点,每天进步一点
dba要细心:字段名顺序乱带来的问题
上一篇 /
下一篇 2008-04-03 17:09:49
/ 个人分类:学习
这次对自己维护的数据库要进行数据清理
create table TB_temp
(
{8H4U%l6e8L0a number,
b number ,
c number not null,ITPUB个人空间kQm;Zy&Nzv
);
--插入数据到临时表中ITPUB个人空间4X.{/|6p$a)P4r9L
insert into TB_temp
select * from tb_table
where a >0;
报错 cannot insert null to c
一查发现
tb_table 的顺序为
a,
c ,
b
所以为了避免这个错误,一定要指定列名
pf0xY}o,G0insert into TB_CLIENT_WIN_LOST_REPBK (ITPUB个人空间)s\)s~L
a,b,c)ITPUB个人空间$Q$A-R+s?
select a,b,c where a>0;
或者
create table tb_temp as select * from tb_test where a>0
也可以避免
所以说 dba要细心,不能为了省事用 select * 来代替
导入论坛
引用链接
收藏
分享给好友
推荐到圈子
管理
举报
TAG: