INSERT INTO tbl_temporary (SELECT * FROM tbl_data_source WHERE condition=1 GROUP BY some_field1,some_filed2 ORDER BY pk_id);