K
Karin J
I would like to create a field with running total of the number of
occurences of each value (I have to do this to work with a legacy
system that expects data like this). I could do this programmatically
looping through the recordset, but wondered if it was possible via
SQL?
So if the field of interest contained letters of the alphabet:
A
B
B
C
B
C
I would like to generate a second field thus:
A 1
B 1
B 2
C 1
B 3
C 2 etc
(it actually doesn't matter "which" B is labelled 1 or 2)
Is this possible via SQL? I thought of generating a count for each
value and doing something via a series of UNION queries with a WHERE
clause based on the count, but highest count is 17 occurences, which
would mean 17 queries unioned together, and that would be a bit
clumsy.
Thankyou
Karin
occurences of each value (I have to do this to work with a legacy
system that expects data like this). I could do this programmatically
looping through the recordset, but wondered if it was possible via
SQL?
So if the field of interest contained letters of the alphabet:
A
B
B
C
B
C
I would like to generate a second field thus:
A 1
B 1
B 2
C 1
B 3
C 2 etc
(it actually doesn't matter "which" B is labelled 1 or 2)
Is this possible via SQL? I thought of generating a count for each
value and doing something via a series of UNION queries with a WHERE
clause based on the count, but highest count is 17 occurences, which
would mean 17 queries unioned together, and that would be a bit
clumsy.
Thankyou
Karin