select c from generate_series(1,:nitems) s
cross join lateral (select * from a where a=s and b=5000) _;
