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




Comments

Contact Form

Send