selecting into temp table sql with group by code example
Example: select into temp table
SELECT *
INTO #temp
FROM (
SELECT col1, col2
FROM table1
) AS x
SELECT *
INTO #temp
FROM (
SELECT col1, col2
FROM table1
) AS x