DemBones79
Programmer
I have a table that stores (among other things) district number and order number. Each order can have multiple transaction dates (each time it has been touched). What I need is a SELECT statement that can give me an ascending sequence for each record grouped by district and order.
So if the columns are: district, order, tr_date
And the data might look like this:
0021, 00001111, 01/12/09
0021, 00001111, 01/15/09
0021, 00001111, 01/23/09
0021, 00001213, 01/14/09
0021, 00001213, 01/16/09
0018, 00001019, 12/27/09
Would need to look like this:
0021, 00001111, 01/12/09, 1
0021, 00001111, 01/15/09, 2
0021, 00001111, 01/23/09, 3
0021, 00001213, 01/14/09, 1
0021, 00001213, 01/16/09, 2
0018, 00001019, 12/27/09, 1
Any ideas?
So if the columns are: district, order, tr_date
And the data might look like this:
0021, 00001111, 01/12/09
0021, 00001111, 01/15/09
0021, 00001111, 01/23/09
0021, 00001213, 01/14/09
0021, 00001213, 01/16/09
0018, 00001019, 12/27/09
Would need to look like this:
0021, 00001111, 01/12/09, 1
0021, 00001111, 01/15/09, 2
0021, 00001111, 01/23/09, 3
0021, 00001213, 01/14/09, 1
0021, 00001213, 01/16/09, 2
0018, 00001019, 12/27/09, 1
Any ideas?