摘要:
/*取今年第一天,取今年最后一天*/ SELECT trunc(sysdate, 'yyyy') AS 今年第一天 , add_months(trunc(sysdate, 'yyyy'), 12) - 1 AS 今年最后一天 FROM dual; 效果如下: 不忘初心,如果您认为这篇文章有价值,认同 阅读全文
摘要:
/*取本季度第一天,取本季度最后一天*/ SELECT trunc(sysdate, 'Q') AS 本季度第一天 , add_months(trunc(sysdate, 'Q'), 3) - 1 AS 本季度最后一天 FROM dual; 效果如下: 不忘初心,如果您认为这篇文章有价值,认同作者的 阅读全文
摘要:
/*取本月月初,取本月月末*/ SELECT trunc( SYSDATE, 'mm' ) AS 月初 , last_day(trunc(sysdate)) AS 月末 FROM dual; 修改如下: 不忘初心,如果您认为这篇文章有价值,认同作者的付出,可以微信二维码打赏任意金额给作者(微信号:3 阅读全文
摘要:
/*取本周第一天(星期一),取本周最后一天(星期天)*/ SELECT trunc( SYSDATE, 'd' ) + 1 AS 星期一 , trunc( SYSDATE, 'd' ) + 7 AS 星期天 FROM dual; 效果如下: 不忘初心,如果您认为这篇文章有价值,认同作者的付出,可以微 阅读全文
摘要:
/*Oracle数据库查询日期在两者之间*/ SELECT EXPIRE_DATE , SUBSTR(EXPIRE_DATE , 1 , 3) FROM ME_EO WHERE ( ISSUE_DATE BETWEEN to_date( '2017-02-04', 'yyyy-MM-DD' ) AN 阅读全文
摘要:
/*转大写*/ SELECT UPPER(TITLE_EN) FROM ME_EO WHERE ( ISSUE_DATE BETWEEN to_date( '2017-02-04', 'yyyy-MM-DD' ) AND to_date( '2017-02-09', 'yyyy-MM-DD' ) A 阅读全文
摘要:
SELECT ATA FROM LM_FAULT WHERE ( OCCUR_DATE BETWEEN to_date( '2017-05-01', 'yyyy-MM-DD' ) AND to_date( '2017-05-15', 'yyyy-MM-DD' ) AND ROWNUM <= 10 ) 阅读全文
摘要:
/*Oracle数据库查询日期在两者之间*/ SELECT DISTINCT ATA FROM LM_FAULT WHERE ( OCCUR_DATE BETWEEN to_date( '2017-05-01', 'yyyy-MM-DD' ) AND to_date( '2017-05-15', ' 阅读全文
摘要:
/*Oracle数据库查询日期在两者之间*/ SELECT PKID, OCCUR_DATE, ATA FROM LM_FAULT WHERE ( OCCUR_DATE BETWEEN to_date( '2017-05-01', 'yyyy-MM-DD' ) AND to_date( '2017- 阅读全文
摘要:
/*Oracle数据库查询日期在两者之间*/ SELECT PKID, OCCUR_DATE, ATA FROM LM_FAULT WHERE ( ( OCCUR_DATE >= to_date( '2017-05-01', 'yyyy-MM-DD' ) ) AND ( OCCUR_DATE <= 阅读全文
摘要:
/*Oracle数据库查询日期在两者之间*/ SELECT PKID, OCCUR_DATE, ATA FROM LM_FAULT WHERE ( ( OCCUR_DATE >= to_date( '2017-05-01', 'yyyy-MM-DD' ) ) AND ( OCCUR_DATE <= 阅读全文
摘要:
/*Oracle数据库查询日期在两者之间*/ SELECT DISTINCT OCCUR_DATE FROM LM_FAULT WHERE ( ( OCCUR_DATE >= to_date( '2017-05-01', 'yyyy-MM-DD' ) ) AND ( OCCUR_DATE <= to 阅读全文
摘要:
/*Oracle数据库查询日期在两者之间*/ SELECT PKID , OCCUR_DATE, PKID || ' 曾经沧海难为水 ' ||TO_CHAR( OCCUR_DATE, ' yyyy/mm/dd hh24:mi:ss ' ) FROM LM_FAULT WHERE ( ( OCCUR_ 阅读全文
摘要:
/*Oracle数据库查询日期在两者之间*/ SELECT PKID , OCCUR_DATE, PKID || TO_CHAR( OCCUR_DATE, ' yyyy/mm/dd hh24:mi:ss ' ) FROM LM_FAULT WHERE ( ( OCCUR_DATE >= to_dat 阅读全文
摘要:
/*日期格式转换*/ SELECT TO_CHAR( OCCUR_DATE, 'yyyy/mm/dd hh24:mi:ss' ) FROM LM_FAULT WHERE ( ( OCCUR_DATE >= to_date( '2017-05-01', 'yyyy-MM-DD' ) ) AND ( O 阅读全文
摘要:
/*Oracle数据库查询日期在两者之间*/ SELECT OCCUR_DATE as "我是一列" FROM LM_FAULT WHERE ( ( OCCUR_DATE >= to_date( '2017-05-01', 'yyyy-MM-DD' ) ) AND ( OCCUR_DATE <= t 阅读全文
摘要:
/*Oracle数据库查询日期在两者之间*/ SELECT OCCUR_DATE FROM LM_FAULT WHERE ( ( OCCUR_DATE >= to_date( '2017-05-01', 'yyyy-MM-DD' ) ) AND ( OCCUR_DATE <= to_date( '2 阅读全文