Posted by littlebeam on 04/12/06 11:47
Suppose there is a table containing these recodes.
country
-------
CON_CHN
CON_JAP
JAP
CON_CHN
When I use the following sql:
select country, count(*) as num from table group by country
the normal result will be:
country num
---------------
CON_CHN 2
CON_JAP 1
JAP 1
However, my desired result is as follows:
country num
-----------------
CON_CHN 2
CON_JAP 2
How can I re-write my SQL? Or any other methods to do that?
[Back to original message]
|