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




Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.