CREATE TABLE T1(a INT,b INT,c INT)
INSERT INTO T1(a,b,c)
SELECT 1,2,3
UNION
SELECT 2,2,4
UNION
SELECT 3,3,3
UNION
SELECT 4,3,5
SELECT *
FROM T1
WHERE a NOT IN (SELECT MAX(a)
FROM T1
GROUP BY b)
CREATE TABLE T1(a INT,b INT,c INT)
INSERT INTO T1(a,b,c)
SELECT 1,2,3
UNION
SELECT 2,2,4
UNION
SELECT 3,3,3
UNION
SELECT 4,3,5
SELECT *
FROM T1
WHERE a NOT IN (SELECT MAX(a)
FROM T1
GROUP BY b)
at 4:25 AM
Labels: SQL Server, SQL Server 2000, SQL Server 2005, SQL Server 2008, SQL Server Tip
No comments:
Post a Comment