All Downloads are FREE. Search and download functionalities are using the official Maven repository.

g1301_1400.s1321_restaurant_growth.script.sql Maven / Gradle / Ivy

The newest version!
# Write your MySQL query statement below
# #Medium #Database #2023_08_14_Time_775_ms_(61.73%)_Space_0B_(100.00%)
with cteX as
(select visited_on, sum(amount) as amount from customer
group by visited_on)

SELECT visited_on, SUM(amount) OVER(ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS amount,
round(AVG(amount) OVER(ROWS BETWEEN 6 PRECEDING AND CURRENT ROW), 2) as average_amount FROM cteX
order by visited_on
limit 6, 10000




© 2015 - 2024 Weber Informatics LLC | Privacy Policy