Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of optimized date Operation in Oracle query

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

Editor to share with you the example analysis of Oracle query optimization date operation, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Add or subtract days, months and years

In Oracle, the date type can directly add or subtract the number of days, while the addition and subtraction of months use the add_months function.

Select a.hiredate hire date, a.hiredate + 5 plus 5 days, a.hiredate-5 minus 5 days, add_months (hiredate, 5) plus 5 months, add_months (hiredate,-5) minus 5 months, add_months (hiredate, 5 * 12) plus 5 years, add_months (hiredate,-5 * 12) minus 5 years from emp a where rownum

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report