Create table t1 (col1 (number), col2 (number), col3 (number);
Insert into t1 values (1,1,1);
Insert into t1 values (1,2,5);
Insert into t1 values (1,3,1);
Insert into t1 values (2,1,1);
Insert into t1 values (2,1,1);
Desired result
col1 col2
1 3
2 2
我需要返回col1中的值以及col 2中为每个不同col1值找到的值的计数。不需要col3
答案 0 :(得分:1)
select col1, count(col1) from t1
group by col1