Thursday, 29 June 2017

How to Generate Sequence without using Ranking functions in SQL Server?

Ans:
Spose you have a temp table with only one column 'A' as above, Now you can use following query to generate sequence




SELECT COUNT(*) OVER(ORDER BY A, CONCAT(A,NEWID())) RN,  A FROM #temp1





WHAT OTHERS ARE READING/RELATED TO THIS:

0 comments:

Post a Comment