locked
LINQ query to get the top 1 from each group by first date RRS feed

  • Question

  • User-1967952962 posted

    I have the SQL query .. How to do the same in linq

    ;WITH cte AS
    (
    SELECT [TYPE]
    ,[SEC_ID]
    ,[STDATE]
    ,[FILENM],
    ROW_NUMBER() OVER (PARTITION BY [SEC_ID] ORDER BY [STDATE] asc) AS rn
    FROM [CFileData]
    )
    SELECT *
    FROM cte
    WHERE rn = 1

    Friday, October 6, 2017 3:04 PM

Answers