create table aaaa ( cid int , a varchar (10) ,b varchar(10),c varchar(10))insert into aaaa
select '1', '001','A','y'
union all select '2','001','A','x'
union all select '3','002','A','X'
union all select '4','002','B','X'
union all select '5','003','A','Y'
union all select '6','003','A','X'要求结果 001  A   y
002  A   x
002  B   x
003  A   yselect a ,b from aaaa group by a , b 
第三列可取重复的其中一项的值  如果不通过关联可以写出来么