Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f51c125

Browse filesBrowse files
committed
Update README.md
1 parent 2597d2b commit f51c125
Copy full SHA for f51c125

File tree

1 file changed

+14
-0
lines changed
Filter options

1 file changed

+14
-0
lines changed

‎README.md

Copy file name to clipboardExpand all lines: README.md
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,4 +592,18 @@ GROUP BY title
592592
ORDER BY AVG(rating) DESC, title ASC
593593
LIMIT 1
594594
)
595+
```
596+
597+
[1321. Restaurant Growth](https://leetcode.com/problems/restaurant-growth/)
598+
```sql
599+
-- pay: last 7 days (today inclusive) - avg.amt (round, 2)
600+
601+
SELECT visited_on, amount, ROUND(amount/7, 2) AS average_amount
602+
FROM (
603+
SELECT DISTINCT visited_on,
604+
SUM(amount) OVER(ORDER BY visited_on RANGE BETWEEN INTERVAL 6 DAY PRECEDING AND CURRENT ROW) AS amount,
605+
MIN(visited_on) OVER() day_1
606+
FROM Customer
607+
) t
608+
WHERE visited_on >= day_1+6;
595609
```

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.