select rowid % 10, count(*) from nulls group by 1 order by 1 0|10 1|10 2|10 3|10 4|10 5|10 6|10 7|10 8|10 9|9