(Came up with this question in the course of trying to answer this other one)
Consider the following MS-SQL table, called GroupTable:
GroupID ------- 1
Can you try using a Sequence or something similar? Where you select from a Sequence and it will give you the next value in the sequence.