Viewing 2 posts - 1 through 2 (of 2 total)
Book looks good. I use OVER to add a sequential number to rows that have duplicate IDs.
SELECT PID, ROW_NUMBER() OVER(PARTITION BY PID ORDER BY PID) AS LINE_NUM
FROM MyTable
December 5, 2013 at 6:07 am
#1671026
Also supported in Datacenter Edition in 2008 R2.
http://msdn.microsoft.com/en-us/library/cc645993(v=SQL.105).aspx
May 12, 2010 at 5:55 am
#1166117