oracle使用between and邊界問題


如果是只查詢某兩個月之間的數據,會默認從每個月的1號開始查,包前包后

eg:select * from test_hsj where regdate between to_date('2015-05','yyyy-MM') and to_date('2015-06','yyyy-MM')

 

如果是只查詢某兩年之間的數據,會默認從1月1日開始查,包前包后

eg:select * from test_hsj where regdate between to_date('2015','yyyy') and to_date('2016','yyyy')

 

如果是只查詢數字類型或者字符類型的數據,包前包后

eg:select * from test_hsj where id between 1 and 5;


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM