mysql 表的相關操作

mysql 表的相關操作

創建表?

create?table?tt

沒有才創建表?

create?table?if?not?exists?tt

復制表結構?

create?table?t2?like?t1??  create?table?t2?select?*?from?t1?where?1?=?2

復制表的數據

結果一樣的話,

insert?into?t2?select?*?from?t1

只需要復制某些字段,

insert?into?t2?(column1,?column2,?...)?select?(column1,?column2,?...)?from?t1

以上就是mysql 表的相關操作的內容,更多相關內容請關注PHP中文網(www.php.cn)!

? 版權聲明
THE END
喜歡就支持一下吧
點贊11 分享