如果表非常大,需要用rownum查询指定的几条,下面命令可以实现
select * from(
select *
from T_NB_COPY t
order by create_time desc
) b where rownum <= 5
去重及时间段获取
select distinct t.device_id from T_RECEIVE_LOG t where t.receive_time <= to_date('2018-02-28 00:00:00','yyyy-mm-dd hh24:mi:ss') and t.receive_time >= to_date('2018-02-27 00:00:00','yyyy-mm-dd hh24:mi:ss')