Hi.

I need to do a traduction this stored procedure in MSSQL to MYSQL.
Can you help me?

Code:
SELECT * FROM Int ORDER BY ID

SELECT 
	T1.*
	-- , T2.*
	, DateDiff(n,T2.HOUR,T1.HOUR) AS Diff
INTO
	#TMP
FROM
	Int T1 JOIN Int T2 ON T1.DIST=T2.DIST AND T1.DATE=T2.DATE
ORDER BY
	T1.ID

-- SELECT * FROM #Tmp

DELETE FROM #TMP WHERE Diff <0
SELECT * INTO #Tmp2 FROM #TMP WHERE Diff>60

DELETE FROM #TMP WHERE ID IN (SELECT ID FROM #TMP WHERE Diff >0 AND Diff<60)
DELETE FROM #TMP WHERE ID IN (SELECT ID FROM #TMP GROUP BY ID HAVING COUNT(ID)>1)

INSERT INTO #Tmp SELECT * FROM #Tmp2
SELECT * FROM #Tmp ORDER BY ID
-- SELECT * FROM #Tmp2

DROP TABLE #Tmp
DROP TABLE #Tmp2