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
pradeep53444
Messages: 2
Registered: November 2009
Location: Bangalore
Junior Member
I got table like this

ID MILES
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
ramoradba
Messages: 2454
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: 63808
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".

Regards
Michel

[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: Wed Sep 28 15:56:41 CDT 2016

Total time taken to generate the page: 0.12682 seconds