Re: Creating sequence for group by in a query?



Well, in actuality, yes, this is what I want, but the problem is that
the "GROUP" column needs to be unique (it's a key)

Yea BTW in your example it definitely wasn't unique.
If you need unique then use row_number instead (of course it starts
from 1 every time) or read about other analytic functions in data
warehousing guide.

Gints Plivna
http://www.gplivna.eu/

.