AllExperts > Oracle 
Search      
Oracle
Volunteer
Answers to thousands of questions
 Home · More Oracle Questions · Answer Library  · Encyclopedia ·
More Oracle Answers
Question Library

Ask a question about Oracle
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About 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

 
   

You are here:  Experts > Computing/Technology > Oracle > Oracle > DECODE Function in pl/sql

Oracle - DECODE Function in pl/sql


Expert: Edson - 6/21/2009

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

Add to this Answer   Ask a Question


 
User Agreement | Privacy Policy | Kids' Privacy Policy | Help
Copyright  © 2008 About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.