SELECT OrderNo, Line, ROW_NUMBER() OVER(ORDER BY OrderNo) AS 'Row'
Open in new window
SELECT t1.OrderNo, t1.LineNo, COUNT(T2.OrderNo) AS Sequence
FROM SomeTable t1 INNER JOIN
SomeTable t2 ON t1.OrderNo = t2.OrderNo AND t1.LineNo >= t2.LineNo
GROUP BY t1.OrderNo, t1.LineNo
ORDER BY t1.OrderNo, t1.LineNo
ROW_NUMBER() OVER (PARTITION BY [Order] ORDER BY [Line-Number]) [Line Sequence]
Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.