Home Forums SQL Server 2005 T-SQL (SS2K5) T-SQL Function that works like the FIRST funcion in MS Access? RE: T-SQL Function that works like the FIRST funcion in MS Access?

  • Could it be as simple as this?

    SELECT

    s.Space_Number,

    MIN(e.First) AS First1,

    MIN(e.Last) AS Last1,

    MAX(e.First) AS First2,

    MAX(e.Last) AS Last2,

    MIN(e.CC) AS FirstOfCC,

    MIN(e.[Employee Type]) AS [FirstOfEmployee Type],

    s.[Space Type]

    FROM Spaces s

    LEFT JOIN Employee e

    ON s.Space_ID = e.Space_Number

    GROUP BY s.Space_Number, s.[Space Type];


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]