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