一、天彙總例句
1、昨天的資料彙總
startday>=to_char(trunc($startday-1),'yyyymmdd')
and startday =to_char(trunc($startday-10),'yyyymmdd')
and startday =to_char(trunc($startday,'mm'),'yyyymmdd')
and startday =to_char(trunc($startday,'mm')+4,'yyyymmdd')
and startday =to_char(trunc($startday,'d')+1,'yyyymmdd')
and startday =to_char(trunc($startday-n/24,'hh24'),'hh24')||'0000' and
starttime說明:$startday為時間標量 函式to_char($startday,'yyyymmdd')用來求日期以年月日的形式轉化為char型別
函式to_char(trunc(sysdate-n/24,'hh24'),'hh24')用來將求得日期以24小時制的形式轉化為char型別
ORACLE 實用函式總結
1 nullif expr1,expr2 邏輯等價於 case when expr1 expr2 then null else expr1 end 如果兩個表示式相等,nullif 返回null 如果兩個表示式不相等,nullif 返回第乙個 expr1 的值。2 nvl expr1,expr2 邏...
Oracle日期函式和迴圈總結
一,日期相關的函式 select to char sysdate,q from dual 指定日期的季度 select to char sysdate,mm from dual 月份 select to char sysdate,ww from dual 當年第幾周 select to char s...
ORACLE 日期函式
1.select to char to date 2011 5 1 yyyy mm dd day from dual 返回星期日 select to char to date 2011 5 1 yyyy mm dd day nls date language american from dual 返...