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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is %rowtype in pl sql?

990


how can you see all indexes defined for a table? : Sql dba

1000


What is join view in sql?

945


What types of commands can be executed in sql*plus?

1109


how to use regular expression in pattern match conditions? : Sql dba

1031


What is the use of sqlerrd 3?

944


what are the differences between char and nchar? : Sql dba

1115


Explain 3 basic parts of a trigger.

1323


What is the use of stored procedures?

1053


Why is the cursor important?

1043


What is rank () in sql?

942


how to shutdown mysql server? : Sql dba

1103


What are different types of keys?

1106


How do I get sql certification?

975


Does sql full backup truncate logs?

1017