通常选择重复记录,都需要用到distinct,但有个不好的地方,就是不能选择多个字段,上网找了良久,在动网发现一个贴解决这个问题,利用的下面的语句:
sql="select a,b from tab where id in (select min(id) from tab group by a)"