select count(*) AS c FROM table group by letter
得到
a  1
b  3
c  2
d  1再用程序判断结果集中不含有的letter