MySQL的create table as 與 like區別
對於mysql的複製相同表結構方法,有create table as 和create table like 兩種,區別是什麼呢?
create table t2 as select * from t1 where 1=2 ; 或者 limit 0;
as建立出來的t2表(新表)缺少t1表(源表)的索引資訊,只有表結構相同,沒有索引。
create table t2 like t1 ;
like 建立出來的新表包含源表的完整表結構和索引資訊
二者的用途:
as用來建立相同表結構並複製源表資料
like用來建立完整表結構和全部索引
相關文章
- insert into select 與 create table as的用法和區別(轉)
- create table of mysql databaseMySqlDatabase
- table move 與 shrink 的區別
- MySQL5.6 create table原理分析MySql
- MySQL的@與@@區別MySql
- alter table move 與shrink space的區別
- 【轉】dbms_stats.gather_table_stats與analyze table 的區別
- save() create()區別
- drop table和truncate table的區別
- Postgresql與MySQL的區別MySql
- Mysql與mongodb的區別MySqlMongoDB
- mysql與Oracle的區別MySqlOracle
- dbms_stats.gather_table_stats與analyze table 的區別[轉貼]
- dual表與create table語句的關係
- Truncate table 詳解及與delete,drop 的區別delete
- Truncate table詳解及與delete,drop的區別delete
- create index/create index online區別Index
- 【MySQL】now()與sysdate()的區別MySql
- create table中的buffer pool 設定 KEEP 及CACHE 引數的聯絡及區別
- Object.create(null) 和 {} 的區別ObjectNull
- Flashback database與flashback table使用條件區別Database
- MySQL語法中=與:=的區別MySql
- Mysql與Oracle的50個區別MySqlOracle
- 幽默:MySQL與mongodb區別MySqlMongoDB
- alter table move 和 alter table shrink space的區別
- mysql與redis的區別與使用場景MySqlRedis
- table中cesllspacing與cellpadding的區別詳解padding
- create a partition table using a exsit table
- MySQL與SQLite的區別及遷移MySqlSQLite
- Oracle與MySQL的幾點區別(轉)OracleMySql
- Oracle Create Table as SelectOracle
- MySQL模糊查詢(like)時區分大小寫MySql
- Oracle --- PLAN_TABLE$和PLAN_TABLE區別Oracle
- MySQL中TEXT與BLOB欄位型別的區別MySql型別
- MySQL字元資料型別char與varchar的區別MySql字元資料型別
- v$lock之alter table drop column與alter table set unused column區別系列五
- alter table move跟shrink space的區別
- create table if not exists Waiting for table metadata lockAI