等同于select a.* 
from blacklist a,
(select num,max(line) as line from blacklist group by num) b
where a.num = b.num
ORDER by a.num , b.line
楼主需要慢慢消化一下

解决方案 »

  1.   

    先找num相同的行,再分组,取max
      

  2.   

    翻译成中文就理解了
    select * from blacklist t where line = (select max(line) from blacklist where num = t.num)
    从blacklist表中查询满足条件 所有num字段相等的记录中不存在line比自己小 所对应行的所有信息
      

  3.   

    select t.* 
    from blacklist t,
    (select num,max(line) as line from blacklist group by num) n
    where a.num = n.num
    ORDER by t.num , n.line
      

  4.   

    select * from blacklist t where line = (select max(line) from blacklist where num = t.num)
    ORDER by num , line--子查询中也有t