日期:2014-05-17  浏览次数:20633 次

求HQL语句
现在要实现 查询24小时以内的20条数据 应该怎么写Hql语句呐????
其中id为该条数据保存时的时间,并精确到毫秒;
想用转化id后的数据与转化sysdate后的数据做对比;
急! 在线等着!!!

------解决方案--------------------
select * from (
select t.*, rownum rn from t where to_date(id, 'yyyymmddhh24miss') > (sysdate - 1) order by id desc
)
where rn <= 20