On 1/27/23 14:20, David G. Johnston
wrote:
Yeah, it wasn't when that was the last bit executed...On Fri, Jan 27, 2023 at 1:59 PM Rob Sargent <robjsargent@xxxxxxxxx> wrote:
I'm trying to craft SQL to invoke a sequence nextval once per grouped value.
This seems like a very unusual usage of nextval/sequences...
with cleanup as (), compute as (select ma, pa, nextval(...) from cleanup)select * from compute ... -- do whatever else you want
Your "order by mates" in the CTE is totally pointless and wasting resources.
David J.
Seems asking a sequence for an id isn't too unusual? Or are they specifically intended for primary keys?