I have this chunk of SQL from a stored procedure and i can convert almost all of it, except for the ‘INTO #t1’ line which i believe is a temporary table:
SELECT siteid, MIN(Eload) + dbo.GetOffset(siteid, 'Eload', MIN(time)) AS Eload
INTO #t1
FROM calcdata WITH (NOLOCK)
WHERE siteid IN (SELECT siteid FROM community_site WHERE communityid = @communityid)
AND time between @start AND @finish
AND Eload < 1000000
AND Eload <> 0
GROUP BY siteid
What is the MySQL equivalent of the INTO #t1 line?
Thanks
You should use INSERT … SELECT statement instead of SELECT with INTO.