--取第几天的数据。select*fromtablewheretrunc(sysdate)-trunc(cr)=1;select*fromtablewheretrunc(sysdate)-trunc(cr)=2;select*fromtablewheretrunc(sysdate)-trunc(cr...
分类:
数据库 时间:
2015-09-30 16:22:39
阅读次数:
239
一、24小时的形式显示出来要用HH24select to_char(sysdate,'yyyy-MM-dd HH24:mi:ss') from dual;select to_date('2005-01-01 13:14:20','yyyy-MM-dd HH24:mi:ss') from dual;二...
分类:
数据库 时间:
2015-09-26 22:34:49
阅读次数:
370
在mysql中,now()和sysdate()两个函数都可以返回当前时间,但是两者是有区别的。下面我们先来看一下mysql的官方解释: NOW()?returns a constant time that indicates the time at which the statement began to...
分类:
数据库 时间:
2015-09-24 11:11:02
阅读次数:
235
1.插入insert into t_user t (t.user_id,t.user_name,t.create_time,t.update_time)values('10','11',sysdate,sysdate);2.更新update T_USER t set t.update_time = ...
分类:
数据库 时间:
2015-09-23 19:19:43
阅读次数:
197
1、获取系统时间、当前时间 select sysdate from dual2、日期函数 在sql语句中使用日期计算时,必须使用日期函数将字符串转为日期型,不像sql server 中直接用字符串就可以了 to_date("字符串","转换的格式") to_char(日期,"转换格式" ) 即把.....
分类:
数据库 时间:
2015-09-23 16:53:38
阅读次数:
229
where trunc(to_date(DATETIME,'yyyy-MM-dd hh24:mi:ss'))=trunc(sysdate)
分类:
数据库 时间:
2015-09-21 17:45:16
阅读次数:
193
createtablet1asselect*fromdba_objects;SCOTT@ORA12C>selectsysdatefromdual;SYSDATE-------------------2015-09-2014:54:101rowselected.SCOTT@ORA12C>deletefromt1;0rowsdeleted.SCOTT@ORA12C>commit;Commitcomplete.SCOTT@ORA12C>selectcount(*)fromt1; COUNT(..
分类:
数据库 时间:
2015-09-21 01:51:31
阅读次数:
219
1、制造数据时出现错误 ORA-30009问题 计划任务:insert into test select rownum,sysdate from dualconnect by rownum<100000会出现ORA-30009 connect-by出错 修改任务:insert into test.....
分类:
数据库 时间:
2015-09-08 00:19:42
阅读次数:
179
orcale将日期格式化为“yyyy年mm月dd日”的形式,懂的人不难,不懂的人就怎么也整不出来。 如下: select?to_char(sysdate,‘yyyy"年"mm"月"dd"日"‘)?from?dual...
分类:
其他好文 时间:
2015-08-18 19:55:53
阅读次数:
179
Oracle和mysql的一些简单命令对比 1) SQL> select to_char(sysdate,'yyyy-mm-dd') from dual; SQL> select to_char(sysdate,'hh24-mi-ss') from dual; mysql> select d...
分类:
数据库 时间:
2015-08-15 21:15:18
阅读次数:
183