I have a user table that has age column. I need to be able to dynamically create set of ranges and pass it to the procedure, for example:
[
[0, 10],
[10, 18],
[18, 35],
]
As a result, it needs to return values count that belong to each range. Example:
|min|max|count|
---------------
| 0| 10| 24|
| 10| 18| 111|
| 18| 35| 0|
How can I implement such procedure?