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
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 |
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 |
Answer / sudeep ranjan
select gender,count(gender)as gender_count from emp group
by gender;
Is This Answer Correct ? | 5 Yes | 1 No |
Answer / venkat
select Count(gender) from emp group by gender with rollup
Is This Answer Correct ? | 1 Yes | 0 No |
What is Temp Table and type of temp table?
What is clustered index sql?
Can we rollback delete command?
Explain the concept of normalization.
How many types of relationship are there?
Why schema is used in sql?
Mention what does the hierarchical profiler does?
What is the best partition size for windows 10?
How much does sql certification cost?
How many scalar data types are supported in pl/sql?
What data types does pl/SQL have?
What is record in pl sql?