SQL: Add incrementing Counter to View output
Posted on 2008-10-30
Additonal request poseted under new question
*** Note this is a SQL 2000 DB
The application we run calls a view, the view output is used in a labeling program. I can modify the view, but cannot modify anything within the application that calls it.
I am looking to add a counter to the views output. Each time the view is called, each row needs to have an incrementing number assigned. The current output of the view is grouped by a field (Order_ID). On each change of this Order ID within the view result, the counter needs to reset to 1
Order_ID Counter Carton_ID
100 1 5000
100 2 5001
100 3 5002
101 1 5003
101 2 5004
102 1 5004
As I mentioned, I cannot touch the application, only the view. Is there anyway to accomplish this ??