Hello Experts Exchange
I need to write a stored procedure that will run on Oracle every Monday morning. I am new to store procedure so not sure exactly how to write it.
I have attached a spreadsheet that has a table design in it. The table design is a example of how I want the data to look like once the stored procedure has run, but I want it for a full year.
To build the table I need to use the data from the Retail_Weeks sheet where it has the month and the start week number and the end week number.
In the spreadsheet is a data sheet, this is example data. I need to group the data by SI_Week and get a Total of TTL_Income this need to go across the first line. On the second line I need to group by the SI_Week and get a total of VAT_TOT.
As you can see on the table design I have January, February, March these need to be the total for the weeks that make up that month.
There is also a YTD this is a total for all the weeks in the year.
Can someone help me to build the SQL Query I need to build this table please?