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 the difference between null value, zero, and blank space?

1139


How many sql databases can you have on one server?

1018


Which command is used to call a stored procedure?

954


Explain raise_application_error.

1044


What is the size of partition table?

992


What is a variable in sql?

953


What is the cause of mutating table error and how can we solve it?

994


how to show all tables with 'mysql'? : Sql dba

1060


What do you understand by pl/sql packages?

1019


What is sqlcommand?

965


How do you add a column to a table?

996


Will truncate release space?

890


Is sql a backend language?

1043


Can we use rowid as primary key?

944


What is Histogram?

1506