oracle之trunc(sysdate)
--截取后得到的仍为date数据类型
select trunc(sysdate) from dual;--2017-03-13 00:00:00
select trunc(sysdate+1) from dual;--2017-03-14 00:00:00 加一天
select trunc(sysdate,'yyyy') from dual;--2017-01-01 00:00:00
select trunc(sysdate,'MM') from dual;--2017-03-01 00:00:00
select trunc(sysdate,'DD') from dual;--2017-03-13 00:00:00
select trunc(sysdate,'HH') from dual;--2017-03-13 11:00:00
select trunc(sysdate,'MI') from dual;--2017-03-13 11:34:00
select trunc(sysdate,'ss') from dual;--精度说明符错错误
select sysdate+1 from dual;--2017-03-13 11:36:10
select sysdate+1 from dual;--2017-03-14 11:36:10 加一天
oracle之trunc(sysdate)的更多相关文章
- Oracle的trunc和dbms_random.value随机取n条数据
今天在review项目代码的时候看到这样一个问题,有一张号码表,每次需要从这样表中随机取6个空闲的号码,也就是每次取出来的6个号码应该都会有所不同.然后我就看到了这样的SQL select t.* ...
- ORACLE时间函数(SYSDATE)深入理解
ORACLE时间函数(SYSDATE)深入理解 加法 select sysdate,add_months(sysdate,12) from dual; --加1年 select sysdate,add ...
- Oracle中trunc函数、round 函数、ceil函数和floor函数的使用
Oracle中trunc函数.round 函数.ceil函数和floor函数的使用 1.1trunc函数处理数字 trunc函数返回处理后的数值,其工作机制与ROUND函数极为类似,只是该函数不对指定 ...
- oracle中 trunc(),round(),ceil(),floor的使用
oracle中 trunc(),round(),ceil(),floor的使用 原文: http://www.2cto.com/database/201310/248336.html 1.round函 ...
- ORACLE时间函数(SYSDATE)简析
ORACLE时间函数(SYSDATE)简析 分类: 原文地址:ORACLE时间函数(SYSDATE)简析 作者:skylway 加法 select sysdate,add_months(sysdate ...
- oracle中trunc()和to_char()函数用法
-----trunc(for date) select sysdate from dual; --当前时间 2016/9/7 10:32:04select trunc(sysdate) from d ...
- oracle函数--trunc
作用:截取 语法:trunc(date,[fmt]) TRUNC函数,ORA-01898 精度说明符过多 TRUNC(SYSDATE)即可默认当前日期(年月日),---写到这一步就好了 TRUNC ...
- trunc sysdate
select * from per_all_people_f papf where trunc(sysdate) between trunc(papf.effective_start_date) a ...
- oracle函数trunc的使用
1.日期比较时精确到日,可以使用 TRUNC(sysdate,'dd')函数.函数支持格式有:yyyy MM dd hh Mi可以用 select TRUNC(sysdate,'yyyy') ...
随机推荐
- Oracle PLSQL Demo - 04.数字FOR LOOP循环[NUMBERABLE (FOR) LOOP]
declare v_display ); begin .. loop .. loop dbms_output.put_line(i || ' - ' || j); end loop; end loop ...
- 给class添加id封装
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- 带limit的hivesql排序
带limit的hivesql排序 select requestdomain,count(1) as cnt from ods_cndns_real_log where dt = 20160707 ...
- IE11不支持Selenium 2.0的解决方法
题前话(Pre-words) 希望使用Selenium 2.0的人看到这篇文章能够收藏此文,以后遇到该问题,再也不用花费多余的时间进行research了!本文就是对网上所有千奇百怪各种各样的searc ...
- VC中使用Matlab Engine出现"无法找到libeng.dll"的问题
VC中使用Matlab Engine出现"无法找到libeng.dll"的问题 本以为使这个原因 ,其实不是我2了 #include "engine.h" // ...
- Ajax初窥
Ajax四个步骤 1. 创建Ajax对象2. 连接到服务器3. 发送请求4. 接收返回值 0x01 创建AJAX对象 方法1(非IE6.0) Var oAjax = new XMLHttpReques ...
- SpringMVC 拦截器实现
SpringMvc实现拦截器方式一: <mvc:interceptors> <mvc:interceptor> <mvc:mapping path="/**&q ...
- Nginx下轻松开启Drupal简洁链接
大家都知道Drupal在apache环境下使用简洁链接是件很轻松的事,因为官方已经把写好的.htaccess文件附在源代码里,一般在配置里直接就可以打开了.但在Nginx下却没有那么简单,但不用担心, ...
- HTTP小结
http 一.HTTP协议简介 HTTP是hypertext transfer protocol(超文本传输协议)的简写,它是TCP/IP协议的一个应用层协议,用于定义WEB浏览器与WEB服务器之间交 ...
- Hibernate-HQL&QBC基础使用(分页)
@Test public void testHql() { Configuration configuration = new Configuration().configure(); Session ...