码迷,mamicode.com
首页 > 其他好文 > 详细

like 索引 整表复制

时间:2016-06-28 23:23:44      阅读:259      评论:0      收藏:0      [点我收藏+]

标签:

1 like
SELECT column_name(s) FROM table_name  WHERE column_name LIKE pattern
SELECT * FROM Persons  WHERE City LIKE ‘N%‘以N开头
SELECT * FROM Persons WHERE City LIKE ‘%g‘以g结尾
SELECT * FROM Persons WHERE City NOT LIKE ‘%lon%‘ 不包含



2 复制整个表结构,1=1 包含所有数据 1=0 只有一结构 ,这里备份所有人口数据,方便整理数据结构
/*create table D_PBASEINFO as select * from  OE.C_PBASEINFO where  1=0*/

create table QPERSIONAYC_GS_PBASEINFO1 as select * from  OE.QPERSIONAYC_GS_PBASEINFO where  1=1;
create table QPERSIONAZ_GS_PBASEINFO1 as select * from  OE.QPERSIONAZ_GS_PBASEINFO where  1=1;
create table QPERSIONBLZ_GS_PBASEINFO1 as select * from  OE.QPERSIONBLZ_GS_PBASEINFO where  1=1;
create table QPERSIONCGZ_GS_PBASEINFO1 as select * from  OE.QPERSIONCGZ_GS_PBASEINFO where  1=1;
create table QPERSIONCW_GS_PBASEINFO1 as select * from  OE.QPERSIONCW_GS_PBASEINFO where  1=1;
create table QPERSIONCY_GS_PBASEINFO1 as select * from  OE.QPERSIONCY_GS_PBASEINFO where  1=1;
create table QPERSIONDB_GS_PBASEINFO1 as select * from  OE.QPERSIONDB_GS_PBASEINFO where  1=1;
create table QPERSIONDFX_GS_PBASEINFO1 as select * from  OE.QPERSIONDFX_GS_PBASEINFO where  1=1;
create table QPERSIONDGZ_GS_PBASEINFO1 as select * from  OE.QPERSIONDGZ_GS_PBASEINFO where  1=1;
create table QPERSIONDH_GS_PBASEINFO1 as select * from  OE.QPERSIONDH_GS_PBASEINFO where  1=1;
create table QPERSIONDT_GS_PBASEINFO1 as select * from  OE.QPERSIONDT_GS_PBASEINFO where  1=1;
create table QPERSIONFT_GS_PBASEINFO1 as select * from  OE.QPERSIONFT_GS_PBASEINFO where  1=1;
create table QPERSIONGBD_GS_PBASEINFO1 as select * from  OE.QPERSIONGBD_GS_PBASEINFO where  1=1;
create table QPERSIONGZ_GS_PBASEINFO1 as select * from  OE.QPERSIONGZ_GS_PBASEINFO where  1=1;
create table QPERSIONHJL_GS_PBASEINFO1 as select * from  OE.QPERSIONHJL_GS_PBASEINFO where  1=1;
create table QPERSIONHPJ_GS_PBASEINFO1 as select * from  OE.QPERSIONHPJ_GS_PBASEINFO where  1=1;
create table QPERSIONHZH_GS_PBASEINFO1 as select * from  OE.QPERSIONHZH_GS_PBASEINFO where  1=1;
create table QPERSIONJC_GS_PBASEINFO1 as select * from  OE.QPERSIONJC_GS_PBASEINFO where  1=1;
create table QPERSIONJS_GS_PBASEINFO1 as select * from  OE.QPERSIONJS_GS_PBASEINFO where  1=1;
create table QPERSIONJT_GS_PBASEINFO1 as select * from  OE.QPERSIONJT_GS_PBASEINFO where  1=1;
create table QPERSIONJW_GS_PBASEINFO1 as select * from  OE.QPERSIONJW_GS_PBASEINFO where  1=1;
create table QPERSIONJXQ_GS_PBASEINFO1 as select * from  OE.QPERSIONJXQ_GS_PBASEINFO where  1=1;
create table QPERSIONJZ_GS_PBASEINFO1 as select * from  OE.QPERSIONJZ_GS_PBASEINFO where  1=1;
create table QPERSIONLGY_GS_PBASEINFO1 as select * from  OE.QPERSIONLGY_GS_PBASEINFO where  1=1;
create table QPERSIONLLT_GS_PBASEINFO1 as select * from  OE.QPERSIONLLT_GS_PBASEINFO where  1=1;
create table QPERSIONMZD_GS_PBASEINFO1 as select * from  OE.QPERSIONMZD_GS_PBASEINFO where  1=1;
create table QPERSIONNMF_GS_PBASEINFO1 as select * from  OE.QPERSIONNMF_GS_PBASEINFO where  1=1;
create table QPERSIONPF_GS_PBASEINFO1 as select * from  OE.QPERSIONPF_GS_PBASEINFO where  1=1;
create table QPERSIONPJY_GS_PBASEINFO1 as select * from  OE.QPERSIONPJY_GS_PBASEINFO where  1=1;
create table QPERSIONSBLD_GS_PBASEINFO1 as select * from  OE.QPERSIONSBLD_GS_PBASEINFO where  1=1;
create table QPERSIONSH_GS_PBASEINFO1 as select * from  OE.QPERSIONSH_GS_PBASEINFO where  1=1;
create table QPERSIONSJ_GS_PBASEINFO1 as select * from  OE.QPERSIONSJ_GS_PBASEINFO where  1=1;
create table QPERSIONSJF_GS_PBASEINFO1 as select * from  OE.QPERSIONSJF_GS_PBASEINFO where  1=1;
create table QPERSIONSLT_GS_PBASEINFO1 as select * from  OE.QPERSIONSLT_GS_PBASEINFO where  1=1;
create table QPERSIONTJH_GS_PBASEINFO1 as select * from  OE.QPERSIONTJH_GS_PBASEINFO where  1=1;
create table QPERSIONTYG_GS_PBASEINFO1 as select * from  OE.QPERSIONTYG_GS_PBASEINFO where  1=1;
create table QPERSIONWSY_GS_PBASEINFO1 as select * from  OE.QPERSIONWSY_GS_PBASEINFO where  1=1;
create table QPERSIONXG_GS_PBASEINFO1 as select * from  OE.QPERSIONXG_GS_PBASEINFO where  1=1;
create table QPERSIONXHM_GS_PBASEINFO1 as select * from  OE.QPERSIONXHM_GS_PBASEINFO where  1=1;
create table QPERSIONXHY_GS_PBASEINFO1 as select * from  OE.QPERSIONXHY_GS_PBASEINFO where  1=1;
create table QPERSIONYYC_GS_PBASEINFO1 as select * from  OE.QPERSIONYYC_GS_PBASEINFO where  1=1;
create table QPERSIONZJZ_GS_PBASEINFO1 as select * from  OE.QPERSIONZJZ_GS_PBASEINFO where  1=1;


3对于相同表结构的插入

insert into A
select * from B;

4数据库创建索引
Create index PCScope_STC on PEOPLECOUNT_SCOPE(STREETCODE);

 

like 索引 整表复制

标签:

原文地址:http://www.cnblogs.com/yuanfuqiang/p/5625230.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!