工作中oracle記錄
公司做的系統,為了加快搜索,時間采用數值型的。在sysbase中有datediff和dateadd函數,
在oracle中采用的函數是number_to_date
如:將數值型的時間轉化為標準時間

如:需要查詢今天零點的數值型時間

查詢今天的日期函數

查詢上幾日的日期




select sysdate, sysdate - interval '6' day "Sysdate - 6 days" from dual;
將day修改就可以了,如minute,year,month,second等等導出oracle建表語句ddl語句

導出oracle建試圖的ddl語句也類似

oracle使用sqlplus輸出html,excel,txt的報表
1 SET MARKUP html ON SPOOL ON pre off entmap off //注釋此句
2 SET ECHO OFF
3 SET TERMOUT OFF
4 SET TRIMOUT OFF
5 set feedback off
6 set heading on
7 set linesize 200
8 set pagesize 10000
9 col tablespace_name format a15
10 col total_space format a10
11 col free_space format a10
12 col used_space format a10
13 col used_rate format 99.99
14 spool c:\test.html 或者 test.xls //修改為test.txt,即可輸出文本文件
15 select * from tp_meter;//sql語句
16 spool off
2 SET ECHO OFF
3 SET TERMOUT OFF
4 SET TRIMOUT OFF
5 set feedback off
6 set heading on
7 set linesize 200
8 set pagesize 10000
9 col tablespace_name format a15
10 col total_space format a10
11 col free_space format a10
12 col used_space format a10
13 col used_rate format 99.99
14 spool c:\test.html 或者 test.xls //修改為test.txt,即可輸出文本文件
15 select * from tp_meter;//sql語句
16 spool off
oracle本地備份腳本

posted on 2010-03-14 10:18 duduli 閱讀(426) 評論(2) 編輯 收藏 所屬分類: 數據庫