當你創(chuàng)建臨時表的時候,你可以使用temporary關(guān)鍵字。如: 
復制代碼 代碼如下:
 
create temporary table tmp_table(name varchar(10) not null,passwd char(6) not null); 
復制代碼 代碼如下:
 
create temporary table if not exists sp_output_tmp engine= memory select …from … where ID=current_id; 
復制代碼 代碼如下:
 
mysql> SELECT * FROM temp_table, temp_table AS t2; 
ERROR 1137: Can't reopen table: 'temp_table' 
復制代碼 代碼如下:
 
mysql>ALTER TABLE orig_name RENAME new_name; 
復制代碼 代碼如下:
 
DROP TEMPORARY TABLE IF EXISTS sp_output_tmp; 
新聞熱點
疑難解答
圖片精選