使用 in字句。
例表tablea, 编号字段位id
sql语句可以这样写:
select * from tablea where id in(select max(id) from tablea)
select 表.* from
(select Max(编号) 最大号,合同 from 表 group by 合同) a
inner join 表 on 表.合同=a.合同 and 表.最大号=a.编号
呃
select * from tb where 编号=(select max(编号) from tb)