Home > database >  Oracle data statistics out every year the last working day of each month
Oracle data statistics out every year the last working day of each month

Time:09-30


1, the the current table in the last pen is the last business day of each month of data

How to take out the end of this month the pen? (REPORT_DATE varchar type)

CodePudding user response:

As with m (
Select t. *, row_number (partition by trunc (report_date, 'mm) order by report_date desc) rn
The from t
)
Select * from m where rn=1

CodePudding user response:

Select * from temp where temp. The date in (select last_day (add_months (trunc (sysdate), - rownum + 1)) from all_objects where rownum CodePudding user response:

Take the largest date bai every month
  • Related