SQL Language (MOSC)

MOSC Banner

grouping on range

edited Oct 18, 2011 2:37AM in SQL Language (MOSC) 10 commentsAnswered
Eg.
input

I have a table xx in which a column name is age having number . i want the output as shown below. i want the count of age in the range . pl suggest a sql query
table data :

age
21
23
25
26
29
31
33
32


output

range   count
20-25       3
26-30       2
31-35       3



Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center