I have two fields in a table, with multiple values of field2 for each field1 value. Like this:
I need a SQL that would include a column counting field2 entries for each value of field1, and resetting for each field1 value. So the result would be:
Code:
field1 field2
====== ======
A 232
B 116
A 456
A 565
B 968
Code:
field1 field2 counter
====== ====== =======
A 232 1
A 456 2
A 565 3
B 116 1
B 968 2