Home Forums SQL Server 7,2000 T-SQL Aggregate functions - First, Last, Max, Min etc RE: Aggregate functions - First, Last, Max, Min etc

  • quote:


    In Access, the First and Last functions allow you to retrieve the first or last value (field) within a Group...


    That is percisely what MIN and MAX do.

    Example:

    
    
    SELECT OrderGroup, MIN(ReceivedOn) AS EarliestReceived, MAX(ReceivedOn) AS LatestReceived
    FROM OrderTable
    GROUP BY OrderGroup