[sql] How SQL query result insert in temp table?