摘要:
有 字段A 和B比如数据如下A B1 21 31 4 2 22 3统计出的sql结果:A count1 32 2select a,count(b) from t group by a;--或count(b) over (partition by a) 如统计一级会计科目数量的sql:select fo,count(dispname)from(select substr(subjcode,1,4) fo,bd_accsubj.dispname,bd_accsubj.pk_accsubj, bd_accsubj.pk_glorgbook from bd_accsubjwhere pk_glorgb 阅读全文