RE: Simple Query Help
SET NOCOUNT ON DECLARE @tbl TABLE (GroupId INT,TaskId INT,Created SMALLDATETIME) INSERT @tbl VALUES(1,2,'04/30/03 10:00') INSERT @tbl VALUES(1,4,'04/30/03 10:15') INSERT @tbl VALUES(2,9,'04/30/03 09:00') INSERT @tbl VALUES(2,6,'04/30/03 09:05') SELECT A.GroupId, A.TaskId FROM @tbl A INNER JOIN @tbl B ON A.GroupId = B.GroupId INNER JOIN @tbl C ON A.Created = C.Created GROUP BY A.GroupId, A.Created, A.TaskId HAVING A.Created = MIN(B.Created) […]
2003-05-07