New feature in Seq().
Brought to you by:
dmmorris
An useful feature to add to the SQL Seq() function
would be to restart the sequence when a field in the
table changes. This would allow to sequence groups of
row, e.g.:
SELECT seq(fieldA), field FROM table
SEQ() FieldA
1 AAAA
2 AAAA
3 AAAA
4 AAAA
5 AAAA
6 AAAA
7 AAAA
1 BBBB
2 BBBB
3 BBBB
1 CCCC
2 CCCC
3 CCCC
4 CCCC
It would be also useful to specify the initial
sequence number and the increment: seq(fielda, 5, 5).