select a.*
from 表 a,(select id,max(score) as score from 表 group by id) b
where a.id=b.id and a.score=b.score

解决方案 »

  1.   

    select * from 表 a
    where not exists(
    select * from 表
    where id=a.id and score>a.score)
      

  2.   

    to lsxaa(小李铅笔刀)
    我用的Informix,这个语法
    select x.*,z.* from x,(select abc from z) z 
    就不支持啊。
      

  3.   

    用  zjcxc(邹建) 的方法现在已经可以了。但是不明白的是
    select * from 表 a
    where not exists(
    select * from 表
    where id=a.id and score>a.score)中是否是整条记录比较,因为不像 “字段 not in ()”这种用法,select * from 表
    没有指定具体字段。没想到这样用也行。