Home » SQL & PL/SQL » SQL & PL/SQL » Can anyone guide me...
Can anyone guide me... [message #378185] Mon, 29 December 2008 04:57 Go to next message
Messages: 8
Registered: August 2008
Junior Member
I have a table containing two columns namely Name and Kilometers, the table is like below:

Name Kilometers

Ram 25
Rahim 56
Robert 105
Krishna 85
Abdul 75

I want the Output like below:::

| Distance in KMs | No. Of people |
| below 50 | 1 |
| between 50 and 100 | 3 |
| above 100 | 1 |

Can anyone guide me how to proceed to get the above output.
Re: Can anyone guide me... [message #378193 is a reply to message #378185] Mon, 29 December 2008 05:27 Go to previous message
Michel Cadot
Messages: 63910
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
As this has been asked to you in your previous topics: read OraFAQ Forum Guide.

For instance, "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter), use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).

Use SQL*Plus and copy and paste what you already tried.
Hint: Group By Result Merging

Previous Topic: problem in nested block
Next Topic: Conversion of SQL to function
Goto Forum:

Current Time: Mon Oct 24 02:37:31 CDT 2016

Total time taken to generate the page: 0.05244 seconds