上季度所有月份: ),-ROWNUM),'YYYYMM') LAST_Q A FROM DUAL) CONNECT ; 本季度所有月份: ),-ROWNUM),'YYYYMM') LAST_Q FROM (SELECT TO_CHAR(SYSDATE,'Q') A FROM DUAL) CONNECT ;…
SQL> select round(dbms_random.value(10000,99999)) num from dual;…
前提条件:假设表名为:tableName:时间字段名为:theDate ①查询本周的记录 select * from tableName where DATEPART(wk, theDate) = DATEPART(wk, GETDATE()) and DATEPART(yy, theDate) = DATEPART(yy, GETDATE()) ②查询本月的记录 select * from tableName where DATEPART(mm, theDate) = DATEPART(mm,…
select * from ( select t.*,d.TABLE_NAME,d.QUERY_SQL,d.data_control_col,d.id table_id,d.where_sql from REPORT_KPI_INFO t left join REPORT_KPI_TABLE_INFO d on t.id = d.kpi_id where t.kpi_status=1 <if test="keyword != null and keyword != ''">…
<?php     echo date("Ymd",strtotime("now")), "\n";     echo date("Ymd",strtotime("-1 week Monday")), "\n";     echo date("Ymd",strtotime("-1 week Sunday")), "\n";…
用oracle sql对数字进行操作: 取上取整.向下取整.保留N位小数.四舍五入.数字格式化 取整(向下取整): select floor(5.534) from dual;select trunc(5.534) from dual;上面两种用法都可以对数字5.534向下取整,结果为5. 如果要向上取整 ,得到结果为6,则应该用ceilselect ceil(5.534) from dual; 四舍五入: SELECT round(5.534) FROM dual;SELECT round(5…
日期及日期格式: 获取系统日期: sysdate() 格式化日期 to_char(sysdate(),'yyyy-mm-dd,hh24:mi:ss') to_date(sysdate(),'yyyy-mm-dd,hh24:mi:ss') 注: to_char 把日期或数字转换为字符串 to_char(number, '格式') to_char(salary, '$99,999.99') to_char(date, '格式') to_date 把字符串转换为数据库中的日期类型 to_date(ch…
工具类定义: /** * 日期范围工具类 */ var dateRangeUtil = (function () { /*** * 获得当前时间 */ this.getCurrentDate = function () { return new Date(); }; /*** * 获得本周起止时间 */ this.getCurrentWeek = function () { //起止日期数组 var startStop = new Array(); //获取当前时间 var currentDat…
/** * 针对时间的工具类 */ var DateTimeUtil = function () { /*** * 获得当前时间 */ this.getCurrentDate = function () { return new Date(); }; /*** * 获得本周起止时间 */ this.getCurrentWeek = function () { //起止日期数组 var startStop = new Array(); //获取当前时间 var currentDate = this…
/// 取得某月的第一天 /// </summary> /// <param name="datetime">要取得月份第一天的时间</param> /// <returns></returns> private DateTime FirstDayOfMonth(DateTime datetime) { return datetime.AddDays(1 - datetime.Day); } /**//// <summa…