SELECT
count(1) as 数量,
t.c_state as 开户状态,
m.c_caption as 描述
FROM
tcustinfo t
JOIN TDICTIONARY m ON t.c_state = m.c_keyvalue
and m.l_keyno = '1029'
group by t.c_state,m.c_caption order by count(1) desc
SELECT
count(1) as 数量,
t.c_state as 开户状态,
m.c_caption as 描述
FROM
tcustinfo t
JOIN TDICTIONARY m ON t.c_state = m.c_keyvalue
and m.l_keyno = '1029'
group by t.c_state,m.c_caption order by count(1) desc