Groovy Goodness: Get Row Number In GINQ Result Set
GINQ (Groovy-INtegrated Query) is added since Groovy 4.
With GINQ we can query in-memory collections with SQL like statements.
If we want to get the row numbers for each row in the query result set we can use the implicit variable _rn
.
We must specify _rn
in the select
expression of our GINQ query. We can even use as
to give it a meaningful name in the result set.