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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is a database? : Sql dba

809


what is the difference between truncate and delete statement? : Transact sql

771


Do ddl statements need commit?

724


How many sql statements are used? Define them.

774


What is an example of translating a date into julian format?

773






What are the usages of sql?

752


Explain the working of foreign key?

723


explain advantages of myisam over innodb? : Sql dba

801


Explain the uses of a database trigger?

778


What is restrict in sql?

740


Which command is used to call a stored procedure?

713


How do I run pl sql in sql developer?

855


what is a trigger in mysql? Define different types of trigger. : Sql dba

729


How many types of privileges are available in sql?

967


What is the purpose of primary key?

749