新:
select jg from a where rq=(select max(rq) from a)
select max(price) as price,wlmc,wldj from 表 gruop by wlmc,wldj
SqlServer为例
select * from
(select row_number() over(partition by name order by zh desc) [i],* from tablename) A WHERE A.I=1
Oracle写法参考如下:
select *
from 表 a
where a.物料 || a.时间 in
(select 物料 || 时间
from (select 物料, max(时间) as 时间 from 表 group by 物料))