Group by a range of values - Mailing list pgsql-sql

From Mike Martin
Subject Group by a range of values
Date
Msg-id CAOwYNKYcQR_Fzx0=L+5LBh6zqDXQuA3_a+ggAm5RZ3G6zHNbOQ@mail.gmail.com
Whole thread Raw
Responses Re: Group by a range of values
Re: Group by a range of values
List pgsql-sql
Say I have a field of ints, as for example created by with ordinality or generate_series, is it possible to group by a range? eq

1,2,3,4,5,6,7,8,9,10
step 3
so output is

1 1
2 1
3 1
4 2
5 2
6 2
7 3
8 3
9 3
10 4

thanks

pgsql-sql by date:

Previous
From: John Lumby
Date:
Subject: Re: foreign key referencing inheritance parent
Next
From: Torsten Grust
Date:
Subject: Re: Group by a range of values