Skip to content
Advertisement

mySQL update average amount of last 5 dates when there is gap in dates

I have mySQL table like below, Is there any way I could update the value in table2 to where ? is placed. need the last 5 Days Average Amount when the sales actually registered, from last 5 dates from table-1 for(9th, 7th, 3rd, 30th, 28th)

Advertisement

Answer

here is one way:

to update :

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement