用分组吧,但ID,APPKEY是字符型就麻烦select topic,id,appkey from (select topic,appkey from poll group by topic,appkey) a,(select id from where id=1) b但我不明的你的意思是怎样,只作例子参考!
select distinct topic||id||appkey from poll
select topic,min(id),max(appkey) from test group by topic
select distinct topic,id,appkey from poll
-----------------------------------------
topic,id,appkey
你喜欢什么? 1 144
你喜欢什么? 2 144
你喜欢什么? 3 144
SQL2中的distinct对topic,id,appkey三列都有效
你的id不重复所以是这个结果