Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


how to achieve this problem?i am having table with two
colums like empno,gender.
in gender column, i am having records male,female like that
.my final output will be
male female
5 6

Answers were Sorted based on User's Feedback



how to achieve this problem?i am having table with two colums like empno,gender. in gender column..

Answer / shivaindu

SQL> select sum(decode(gender, 'male', 1)) as Male,
sum(decode(gender, 'female', 1)) as Female from
emp1;

MALE FEMALE
---------- ----------
9 7

Is This Answer Correct ?    16 Yes 1 No

how to achieve this problem?i am having table with two colums like empno,gender. in gender column..

Answer / jayakrishnan

select count(case gender when 'male' then 1 end) Male,
count(case gender when 'female' then 1 end) Female from emp1

Is This Answer Correct ?    5 Yes 1 No

how to achieve this problem?i am having table with two colums like empno,gender. in gender column..

Answer / sudeep ranjan

select gender,count(gender)as gender_count from emp group
by gender;

Is This Answer Correct ?    5 Yes 1 No

how to achieve this problem?i am having table with two colums like empno,gender. in gender column..

Answer / venkat

select Count(gender) from emp group by gender with rollup

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

How is debugging done?

0 Answers  


Why do we use procedures in pl sql?

0 Answers  


What are the types of index in sql?

0 Answers  


what is timestamp in mysql? : Sql dba

0 Answers  


Difference between SUBSTR and INSTR?

3 Answers  


what is the bond code in materialized view?

0 Answers  


How to return an array from java to pl/sql?

0 Answers  


What is the order of sql select?

0 Answers  


What is scope of pl sql developer in future?

0 Answers  


What is sql partition function?

0 Answers  


what is difference between procedure and function, procedure and trigger?

8 Answers   iFlex,


Is sql low level language?

0 Answers  


Categories