INTERVAL

select sysdate - interval '10' day as "10天前",
       sysdate - interval '10' hour as "10小时前",
       sysdate - interval '10' minute as "10分钟前",
       sysdate - interval '10' second as "10秒钟前",
       sysdate - 10 as "10天前",
       sysdate - 10 / 24 as "10小时前",
       sysdate - 10 / (24 * 60) as "10分钟前",
       sysdate - 10 / (24 * 3600) as "10秒钟前"
  from dual;

这里的 interval表示某段时间,格式是: interval '时间' <day/hour/minute/second> ;

例如 interval '10' day 表示10天

上一篇:C语言位操作(转)


下一篇:java中的Sort函数,你值得看