| Ratnaker |
Posted: May 08, 2007 06:19:11 AM |
Total Post: 140
Joined: Apr, 2007
|
Hi tom,
i have one table
empid empname sex
----- ------- ----
1 Joe M
2 Nisha F
3 Raj M
4 Celina F
i want to count who is female in one column and who is male in second column
|
|
|
poonam |
| Posted: May 08, 2007 08:44:36 AM | |
|
Total Post: 7
Joined: May, 2007
|
hi,
sorry i cant understand what u want to find,so can u make your question more clear?
thanks..........
|
|
|
|
|
parth |
| Posted: May 08, 2007 09:47:27 AM | |
|
Total Post: 17
Joined: Apr, 2007
|
SELECT COUNT(EMPID) FROM TEMPDATA.MF
WHERE SEX LIKE 'M'
UNION ALL
SELECT COUNT(EMPNAME)PARTH FROM TEMPDATA.MF
WHERE SEX LIKE 'F'
I HOPE THIS WILL HELP...!
~parth
|
|
|
|
|
Ratnaker |
| Posted: May 09, 2007 03:04:03 AM | |
|
Total Post: 140
Joined: Apr, 2007
|
I want to display like this :
Male Female
---- ------
2 2
K P Ratnaker
|
|
|
|
|
GANESH |
| Posted: May 09, 2007 08:28:02 AM | |
|
Total Post: 1
Joined: May, 2007
|
HERE IS THE QUERY
SELECT count(DECODE(GENDER,'M','Male')) as Male ,count(DECODE(GENDER,'F','Female')) as Female FROM EMP1;
|
|
|
|
|
Ratnaker |
| Posted: May 11, 2007 06:19:18 AM | |
|
Total Post: 140
Joined: Apr, 2007
|
thank you Ganesh,
this is very usefule Query
Ratnaker
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |