Hi!
I am using below script now it is working.
But I want get date from table not manual.
WITH cte_month AS
(SELECT row_number() OVER(PARTITION BY to_char(r.balance_date, 'Month'), to_char(r.balance_date, 'Year') ORDER BY balance_date DESC) row_num,
arrears_in_days,
balance_date,
acct_id
FROM report r
where r.acct_id = '11002140008598'
and (to_char(r.balance_date, 'D')) not in (6, 7))
SELECT * FROM
(
SELECT arrears_in_days, balance_date, acct_id
FROM cte_month
WHERE row_num = 1
)
PIVOT
(
max(balance_date || ' -> ' || arrears_in_days) as dat
FOR balance_date IN ('30.11.2021', '31.12.2021','31.01.2022','28.02.2022','31.03.2022','29.04.2022','31.05.2022','30.06.2022')
)
I want date instead:
IN ('30.11.2021', '31.12.2021','31.01.2022','28.02.2022','31.03.2022','29.04.2022','31.05.2022','30.06.2022')
Using like below:
IN (balance_date)