The date functions provided by Oracle can meet all the daily operations on the date. Generally, when designing the table structure, we often encounter date fields.
The date functions provided by Oracle can meet all the daily operations on the date. Generally, when designing the table structure, we often encounter date fields.
The date functions provided by Oracle can meet all the daily operations on the date. Generally, we often encounter date fields when designing table structures. If the business needs to summarize the data of the week where the given date is located, and summarize the data of each week in the month where the given date is located, it will be complicated to write SQL statements directly.
Therefore, I directly create a date master table in the data, and calculate the statistical fields that may be used first, you only need to connect to the table to obtain the desired result.
The following describes how to create a table and how to generate data. You can add new fields to meet different requirements. You can create related indexes as needed!
We also welcome you to discuss better methods! Do not hesitate to advise!
1. Create a date primary table
2. Insert Date data
3. Set the values of related fields
4. Set the monthly week
5. Set the first and last days of the week.