Input Data Sample:
name | Sex |
---|---|
Furqan | M |
Md | M |
Nazia | F |
Perween | F |
Output:
M | F |
---|---|
2 | 2 |
Solution:
Select m, f from
(select count(case when sex='M' then 1 end) as m,
count(case when sex = 'F' then 1 end) as f from gender
)t ;
name | Sex |
---|---|
Furqan | M |
Md | M |
Nazia | F |
Perween | F |
M | F |
---|---|
2 | 2 |
No comments:
Post a Comment