SELECT t1.FNAME, t1.FCITY, t1.FAGE, t1.FSALARY, t2.cnt
FROM T_Person t1,
(SELECT FCITY, count(FNAME) cnt
WHERE FCITY = t1.FCITY
AND FAGE LIKE substring(FAGE, 1, 1) + '%') t2
WHERE t1.FCITY = t2.FCITY
用FAGE LIKE substring(FAGE, 1, 1) + '%') t2来筛选出该年龄段的。SUBSTR可能在sqlserver里面需要调整下。