使用SQL' aaabbcdFFFFGGH'以下面的格式计数AS
A 3
B 2
C 1
D 1
F 4
G 2
H 1
答案 0 :(得分:0)
this.props.navigation.navigate('AddGradeLevelScreen')
答案 1 :(得分:0)
您没有说明您的DBMS,所以这里是Postgres的解决方案:
select upper(w), count(*)
from regexp_split_to_table('aaabbcdFFFFGGH','') as t(w)
group by upper(w)
order by upper(w);
答案 2 :(得分:0)
如果是偶然的SQL Server
示例强>
Declare @String varchar(max) = 'aaabbcdFFFFGGH'
Select CharVal = Substring(@String,N,1)
,CharCnt = count(*)
From (Select Top (len(@String)) N=Row_Number() Over (Order By (Select NULL)) From master..spt_values N1,master..spt_values N2 ) N
Group By Substring(@String,N,1)
<强>返回强>
CharVal CharCnt
a 3
b 2
c 1
d 1
F 4
G 2
H 1