等同于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
楼主需要慢慢消化一下
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
楼主需要慢慢消化一下
select * from blacklist t where line = (select max(line) from blacklist where num = t.num)
从blacklist表中查询满足条件 所有num字段相等的记录中不存在line比自己小 所对应行的所有信息
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
ORDER by num , line--子查询中也有t