Skip to content
Advertisement

Select Distinct and sequence at the same time

How can I able to use Distinct on select statement along with a sequence on SQL Server

I try this sub-query but no luck I get error of

NEXT VALUE FOR function is not allowed in check constraints, default objects, computed columns, views, user-defined functions, user-defined aggregates, user-defined table types, sub-queries, common table expressions, derived tables or return statements.

Can anyone help me with this?

Advertisement

Answer

Solve thank for the help @Nick.McDermaid my final query looks like this.

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