select 相同成员 from ( select count(left(医疗编号,12)) as 相同成员,left(医疗编号,12) from musterroll group by left(医疗编号,12) order by 相同成员 desc ) as t where 相同成员 >1
left(医疗编号,12)并不包含在聚合函数中,应改为: select 相同成员 from ( select count(left(医疗编号,12)) as 相同成员 from musterroll group by left(医疗编号,12) order by 相同成员 desc ) as t where 相同成员 >1