select * from A
where exists(
   select * from A aa 
   where aa.字段b<>a.字段b and left(a.字段a,3)=left(aa.字段a,3))