I haven't written anything for a while. I think of a function that I wrote to return the number of days when I used the number of days in a certain month in the Oracle query statement.ArticleNow, we have a little time to take it out for your use, and it is also convenient for your future needs.
Code
1 Create Or Replace Function Get_month_days (select_month In Varchar2 )
2 Return Number Is
3
4 Num_of_days Number ( 2 ); -- Number of days returned
5
6 Begin
7
8 /*
9
10 Name
11 Get_month_days
12 Description
13 Returns the total number of days of the month.
14 Arguments
15 V_select_month -- input month, in the format of yyyymm
16
17 */
18
19 Num_of_days: = Add_months (to_date (select_month, ' Yyyymm ' ), 1 ) - To_date (select_month, ' Yyyymm ' );
20
21 Return (Num_of_days );
22
23 End ;
If you have other good methods, share them with us ~