删除表语句
1.2 若要彻底删除表,则使用语句:
drop table table_name purge;
该语句表示:不放入回收站,直接删除。
1.3 drop含有外键的表
drop table table_name cascade constraints; ---也称为称为级联删除 ,何相关视图和完整性约束一并被删除。
创建临时表(相当于拷贝一个d_ss_materialmasterpricedtl8到d_ss_materialmasterpricedtl10 ,不含主键,索引)
create table d_ss_materialmasterpricedtl10 as select * from d_ss_materialmasterpricedtl8;
从一个表的数据导入到另外一个表中(把d_ss_materialmasterpricedtl9的表中数据插入d_ss_materialmasterpricedtl8 )
insert into d_ss_materialmasterpricedtl8 select * from d_ss_materialmasterpricedtl9;
扫描二维码关注公众号,回复:
6607315 查看本文章
//查询是否有重复的数据(查询d_ss_materialmasterpricedtl8 中的id是否有重复)
select t.materialmasterpricedtlid,count(*) from d_ss_materialmasterpricedtl8 t group by t.materialmasterpricedtlid having count(*) > 1