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

Why do we use %rowtype & %type in plsql?

610


what is an extent ? : Sql dba

584


What is nested table in pl sql?

555


Explian rowid, rownum? What are the psoducolumns we have?

574


In a distributed database system, can we execute two queries simultaneously?

571






Can we perform dml on view?

556


What does partition by mean in sql?

515


What is indexes?

544


Does sql*plus also have a pl/sql engine?

563


Is it mandatory for the primary key to be given a value when a new record is inserted?

710


What are the operators used in select statements?

578


What is meant by temporal data?

546


How do I run a pl sql program?

629


What is partition by in sql?

569


How to raise user-defined exception with custom sqlerrm ?

682