SQL Query to get Maximum date with in each month
Hi All. I am looking for sql query to get the maximum date with in each month. sample data below
with sample_data as (
select 1 id,to_date(20200401,'yyyymmdd') process_date, to_date(20200425,'yyyymmdd') end_date from dual union all
select 1 id,to_date(20200426,'yyyymmdd') process_date, to_date(20221231,'yyyymmdd') end_date from dual union all
select 2 id,to_date(20200401,'yyyymmdd') process_date, to_date(20200425,'yyyymmdd') end_date from dual union all
select 2 id,to_date(20200426,'yyyymmdd') process_date, to_date(20221231,'yyyymmdd') end_date from dual union all
select 3 id,to_date(20190929,'yyyymmdd') process_date, to_date(20210313,'yyyymmdd') end_date from dual union all