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

What is column?

0 Answers  


What is java sql drivermanager?

0 Answers  


List the ways to get the count of records in a table?

0 Answers  


how to create a database in oracle?please gve anser with example

1 Answers  


Describe types of sql statements?

0 Answers  


How do I get sql certification?

0 Answers  


What is normalization ?

9 Answers   BirlaSoft, CTS, HCL,


Which is faster joins or subqueries?

0 Answers  


Is sql better than excel?

0 Answers  


Which are the different types of indexes in sql?

0 Answers  


need to split a string into seperate values. eg. col1 col2 ---------- 100 - 'a,b,c' 200 - 'a,x,b,d,e' 300 - 'c' result: value count ------------- a - 2 b - 1 c - 2 etc.

1 Answers  


What is Referential Integrity?

3 Answers  


Categories