I have a table with 3 columns,first column is some parameter and remaining 3 are last 1 week count of those parameter and has content similar like below. first row is table columns from oracle. I have to calculate the difference 2 dates.
Parameter 20190319 20190315 20190313
============================================
A 682 614 600
B 194 194 190
C 62 62 0
Output should be like below,
Parameter 20190319 (20190319-20190315) 20190315 (20190315-20190313) 20190313
========================================================
A 682 68 614 14 600
B 194 0 194 4 190
C 62 0 62 62 0
Here the tricky part is dates are not in sequence and it can be up to 7dates, we have to calculate dynamically from column names. Would be great if can be done in oracle. Thank you!!