Skip to content
Advertisement

SQL Server: CTE, how to get last row number

I have a CTE like this:

How can I get last row with highest number from the query (replace hardcoded 7)?

Advertisement

Answer

If you really need only last row (from your query) then it even simpler (for given case):

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement