>>DECLARE @RecCount int >>SET @RecCount = 50000 - < # of records in previous 2 groups > >>SELECT TOP (@RecCount) >> FROM mytable >> WHERE < record does not belong to 2 previous groups > >> ORDER BY NewID() >>