You are here:

Oracle/DECODE Function in pl/sql

Advertisement


Question
There is a table with three columns name,location& sex.in name column there are different names and in location there are cities like bangalore, chennai, madurai,mhyderbad and sex there are male and female. and my question is using single query we have to display the amount of male and female from each every city.
           i am waiting for your reply
                 thanking you

Answer
select count(*), sex, substr(location,..,..)
 from table
group by sex, substr(location,..,..)

If itīs not what you are expecting, please give some more example and I will create the table here in my database and post to you th results.

Regards...
Wait feedback

Oracle

All Answers


Answers by Expert:


Ask Experts

Volunteer


Edson

Expertise

I can answer questions about Sql (including Sql tuning), pl/Sql and a bit of oracle administration

Experience

I work as a consultant in Brazil and I face problems of all kind in oracle every day development.

Education/Credentials
INFNET, Oracle Database SQL expert

©2012 About.com, a part of The New York Times Company. All rights reserved.