sql查询最近记录距离当前时间多久
1个回答
2016-12-22
展开全部
完整的sql应该是这样的,对于CREATEDATE 进行降序排序
select * from USER order by CREATEDATE ASC
如果之要查询最近的那个日期的所有记录,sql语句如下:
select * from user inner join (select max(CREATEDATE) as C from user) A on user.CREATEDATE=A.C;
select * from USER order by CREATEDATE ASC
如果之要查询最近的那个日期的所有记录,sql语句如下:
select * from user inner join (select max(CREATEDATE) as C from user) A on user.CREATEDATE=A.C;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询