yadakhov
3/30/2012 - 4:06 PM

mysql create tempory table for select statement

mysql create tempory table for select statement

-- TEMP TABLE FOR SELECTS
CREATE TEMPORARY TABLE temp_table AS
SELECT * FROM table1 a JOIN table2 b ON a.id = b.id;

SELECT * FROM temp_table;