I have a table t1 with a column c1, which is of type character(2), and has values ranging between 00:97. I am able to count the number of cases (7632) where c1 contains a single specific value (say 62):
SELECT count(*) FROM t1 WHERE c1='62';
count
-------
7632
(1 row)
However, I am interested in obtaining the count for each of the possible values (00:97) that c1 can obtain. Is there such a syntax available in psql?
select c1, count(*) from t1 group by c1 order by c1;
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다