is there a function that can divide a range of numeric data into sub-categories? for example, if I have data from 1 to 20, and I want result to be group by (1,5), (6,10), (11,15), and (16,20) intervals.
Boa, if the groups are regular groups of 5 you could try grouping by something like [tt]trunc(x/5)[/tt] i.e. the integer result of a division operation (n.b. syntax may vary depending on RDBMS); if not you may want a look up table with lower and upper range bounds and an identifier, join to it where value is between the bounds and group on the identifier.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.