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 sql lookup?
Hi am new to PLSQL & facing problems in writing code like in SP, Functions, so any one having some SP coding with in depth explanation please share with me my Email ID suvarnaatsuvarna@rediffmail.com Or taking tanning on this please do contact me
What is range partitioning?
What is use of trigger?
what are the different tables present in mysql? : Sql dba
difference between pl/sql table and normal pl/sql table
How can we find duplicate records in a table?
How does an execution block start and end in pl sql?
Does it possible to pass object (or) table as an argument to a remote procedure?
i have a table eno dno sal 1 10 200 2 10 150 3 10 100 4 20 75 5 20 100 i want to get sal which is less than the avg sal of thri dept. eno dno sal 2 10 150 3 10 100 4 20 75
What is the limitation on the block size of pl/sql?
How to Declare Fixed Length String Value In PL SQL