i have a table which i would like to group by integer range (ages). table for example:
Name Age
John 21
Steve 24
Dan 29
Mike 31
my expected result is to group the name by age ranges for example [21-28] [29-33] so what i'll get is the following result:
[21-28] [29-33]
John Dan
Steve Mike
i was playing around with the annotate function of Django but couldn't figure it out so far.
any suggestions?