缺乏主键,取最新的记录

select a.guigename,a.thisdayguigeprice,a.createdate
from dailystandardguigeprice as a
inner join (select guigename,max(createdate) as mcreatedate from dailystandardguigeprice group by guigename) as b
on a.guigename=b.guigename and a.createdate=b.mcreatedate

  

posted @ 2021-10-12 16:22  CrossPython  阅读(14)  评论(0编辑  收藏  举报