3C科技 娛樂遊戲 美食旅遊 時尚美妝 親子育兒 生活休閒 金融理財 健康運動 寰宇綜合

Zi 字媒體

2017-07-25T20:27:27+00:00
加入好友
SQL 將一資料表複製到另一個資料表 資料來源: https://dotblogs.com.tw/mis0800/2014/02/09/143889 01.只複製結構,不複製資料  select * into NEW_table Old_table where 1=0 02.複製結構也複製資料  select * into NEW_table from Old_table   03.指定匯入某欄位的資料至新的資料表(指令一執行即產生新table)  select a,b,c into NEW_table from Old_table EX: select ac1,ac2,bc1,bc2 into table_c from table_a inner join table_b on aid=bid 04.將A table某欄位資料複製到B table某欄位  update B set B's column= (select a's column from A where A's column=B's column) 05.選取B_able某欄位匯入資料至「已存在的A_table」的欄位中 Insert into A_table(A.欄1,A.欄2) select (B.欄1,B.欄2) from B_able PS 應用場合: 分表/臨時表/資料備份

本文由jashliaoeuwordpress提供 原文連結

寫了 5860316篇文章,獲得 23313次喜歡
精彩推薦