Home » SQL & PL/SQL » SQL & PL/SQL » Query on multi group (Oracle 8.0)
Query on multi group [message #329376] Wed, 25 June 2008 04:30 Go to next message
Messages: 35
Registered: January 2008
Location: Dubai
Dear Guru,
I need to fetch the data in the following format:
Contint Country States      Agegroup <35 Agegroup 35<55 Agegroup >55 TotalnoofPerson/States TotalSalary/States
Asian   Indian  Tamilnadu   3            5              8            1,152,222
Asian   Indian  Andhra      2            7              3            1,175,675
Asian   Indian  W.Bengal    6            8              3              144,766
Asian   Indian  Delhi       4            7              2            4,335,635

Data Available are:
Nameoftheperson Age Salaray Continent Country States
Kumar           34   5152    Asian     Indian  Tamilnadu
Raju            45   6485    Asian     Indian  Delhi
Vincent         35   3542    African   Nigeria Ooha

Like above, there are many persons and their salary, continet,country,states.

I need to fetch the query for every States and it's No of person in the age group and Total salary of the Age group, country, continent.

thank you in advance.


[Mod-edit: Frank added code-tags to improve readability. Also reformatted the data; there seems to be data missing (total salary)]

[Updated on: Wed, 25 June 2008 08:33] by Moderator

Report message to a moderator

Re: Query on multi group [message #329378 is a reply to message #329376] Wed, 25 June 2008 04:34 Go to previous messageGo to next message
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Experiment with this sort of construct:
Re: Query on multi group [message #329411 is a reply to message #329376] Wed, 25 June 2008 06:32 Go to previous message
Michel Cadot
Messages: 65144
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
please read OraFAQ Forum Guide, especially "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) and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).

Previous Topic: SQL Query Rewrite
Next Topic: ORA-06512
Goto Forum:

Current Time: Sun Aug 20 19:52:45 CDT 2017

Total time taken to generate the page: 0.07234 seconds