select * from t inner join (select distinct left(患者编号,12) as Left12,count(*) as NUM from t group by left(患者编号,12)) a on a.Left12=left(t.患者编号,12) where NUM >3
select * from musterroll where left(医疗编号,12) in ( select 成员 from ( select count(*) as 相同成员,left(医疗编号,12) as 成员 from musterroll group by left(医疗编号,12) ) as t where 相同成员 >1