Everybody a great god help look at how to optimize the following
select a. area,
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 30, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end)/
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 394, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end) - 1 as "6/22,"
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 29, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end)/
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 393, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end) - 1 as "6/23,"
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 28, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end)/
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 392, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end) - 1 as "6/24,"
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 27, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end)/
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 391, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end) - 1 as "6/25,"
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 26, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end)/
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 390, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end) - 1 as "6/26,"
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 25, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end)/
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 389, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end) - 1 as "6/27,"
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 24, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end)/
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 388, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end) - 1 as "6/28,"
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 23, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end)/
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 387, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end) - 1 as "6/29,"
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 22, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end)/
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 386, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end) - 1 as "6/30,"
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 21, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end)/
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 385, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end) - 1 as "7/1,"
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 20, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end)/
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 384, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end) - 1 as "7/2,"
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 19, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end)/
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 383, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end) - 1 as "7/3,"
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 18, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end)/
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 382, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end) - 1 as "7/4,"
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 17, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end)/
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 381, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end) - 1 as "7/5,"
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 16, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end)/
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 380, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end) - 1 as "7/6,"
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 15, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end)/
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 379, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end) - 1 as "7/7,"
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 14, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end)/
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 378, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end) - 1 as "7/8,"
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 13, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end)/
Sum (case when to_char (a. date, 'yyyymmdd')=to_char (sysdate - 377, 'yyyymmdd') then a.t DDV place all electricity proprietary FBP + a.t DDV place small pieces of proprietary FBP + a.t ddvpop end) - 1 as "7/9,"
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull