Skip to content
Create a gist now

Instantly share code, notes, and snippets.

anonymous /gist:1335157
Created Nov 2, 2011

SET NOCOUNT ON
CREATE TABLE #T(X INT)
SELECT MAX(X) FROM #T WHERE X < 0
INSERT INTO #T VALUES(-1)
SELECT MAX(X) FROM #T WHERE X < 0
INSERT INTO #T VALUES(2)
SELECT MAX(X) FROM #T WHERE X < 0
INSERT INTO #T VALUES(3)
SELECT MAX(X) FROM #T WHERE X < 0
INSERT INTO #T VALUES(4)
SELECT MAX(X) FROM #T WHERE X < 0
INSERT INTO #T VALUES(5)
SELECT MAX(X) FROM #T WHERE X < 0
INSERT INTO #T VALUES(6)
SELECT MAX(X) FROM #T WHERE X < 0
INSERT INTO #T VALUES(7)
SELECT MAX(X) FROM #T WHERE X < 0
DROP TABLE #T
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.