15 dicembre 2014

How create a temporary table with a select in MySQL

I take note of this simple sintax:

CREATE TEMPORARY TABLE IF NOT EXISTS temp_table 

( INDEX(col_2) ) ENGINE=MyISAM 

AS ( SELECT col_1, coll_2, coll_3 FROM mytable )

Bye

Nessun commento: