Skip to content
Advertisement

Last record per transaction

I am trying to select the last record per sales order.

My query is simple in SQL Server management.

The problem is that this database has tens of thousands of records, as it tracks all SO steps.

I would to see the most recent record per the SO

Advertisement

Answer

Well I’m not sure how that table has two Name columns, but one easy way to do this is with ROW_NUMBER():

Also please always reference the schema, even if today everything is under dbo.

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