码迷,mamicode.com
首页 > 数据库 > 详细

从数据库表中查询日期最新的记录

时间:2018-04-25 17:07:02      阅读:409      评论:0      收藏:0      [点我收藏+]

标签:sel   sch   数据库   region   select   from   join   bre   数据   

select a.* from data_subtaskregionschedule a inner join(select subregionid,max(updatetime) maxupdatetime
from data_subtaskregionschedule group by subregionid) b on a.subregionid=b.subregionid and a.updatetime
=b.maxupdatetime;

实测可行

从数据库表中查询日期最新的记录

标签:sel   sch   数据库   region   select   from   join   bre   数据   

原文地址:https://www.cnblogs.com/xiaoyuersdch/p/8945281.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!