Home » SQL & PL/SQL » SQL & PL/SQL » i got a query to solve (oracle SQL 10g)
i got a query to solve [message #432083] Sat, 21 November 2009 00:19 Go to next message
Messages: 2
Registered: November 2009
Location: Bangalore
Junior Member
I got table like this

001 48
002 35
003 55
004 85
005 112

I need to display the output in this fashion

Distance Total_No
0-50 miles 2
50-100 miles 2
Above 100 miles 1

the output is the range of values in which miles falls in,and in total_no u need to get how many id's involved in tht range.

Help me
Re: i got a query to solve [message #432087 is a reply to message #432083] Sat, 21 November 2009 00:41 Go to previous messageGo to next message
Messages: 2456
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
Better use a meaningful title....You can deserve your out put by using a simple sql with "case" and "group by".

Please read Orafaq guide lines before posting....

Sriram Smile
Re: i got a query to solve [message #432089 is a reply to message #432083] Sat, 21 November 2009 00:52 Go to previous message
Michel Cadot
Messages: 65085
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
http://www.psoug.org/reference/group_by.html?PHPSESSID=8bd8e1785057c210d9fc9f12e8a7ff74 (if direct link does not work try http://www.psoug.org/reference/ and sroll down to "Group by")
and scroll down to "Group By Result Merging".


[Updated on: Sat, 21 November 2009 00:54]

Report message to a moderator

Previous Topic: get weekday
Next Topic: Help me out with this query too
Goto Forum:

Current Time: Mon Jul 24 16:06:58 CDT 2017

Total time taken to generate the page: 0.29935 seconds