其他分享
首页 > 其他分享> > 缺乏主键,取最新的记录

缺乏主键,取最新的记录

作者:互联网

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

  

标签:guigename,缺乏,记录,createdate,mcreatedate,主键,select,dailystandardguigeprice
来源: https://www.cnblogs.com/pythonClub/p/15398419.html