There is one table T ( id integer, primary key ( id).
I want a parameterized query that, given id i:
will return next consecutive id,
if i = biggest id in T, query should return the smallest id in T (cyclical)
There is one table T ( id integer, primary key ( id). I want
Share
You can select the smallest id over the value @i (if any), and the smallest id, then get the largest:
Or perhaps: