Skip to content

Commit 4bfdb7a

Browse files
authored
feat: add sql solution to lc problem: No.2893 (#1896)
1 parent c51e22f commit 4bfdb7a

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

solution/2800-2899/2893.Calculate Orders Within Each Interval/README.md

+9
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,13 @@ FROM T
9494
WHERE minute % 6 = 0;
9595
```
9696

97+
```sql
98+
SELECT
99+
FLOOR((minute + 5) / 6) AS interval_no,
100+
SUM(order_count) AS total_orders
101+
FROM Orders
102+
GROUP BY 1
103+
ORDER BY 1;
104+
```
105+
97106
<!-- tabs:end -->

solution/2800-2899/2893.Calculate Orders Within Each Interval/README_EN.md

+9
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,13 @@ FROM T
8484
WHERE minute % 6 = 0;
8585
```
8686

87+
```sql
88+
SELECT
89+
FLOOR((minute + 5) / 6) AS interval_no,
90+
SUM(order_count) AS total_orders
91+
FROM Orders
92+
GROUP BY 1
93+
ORDER BY 1;
94+
```
95+
8796
<!-- tabs:end -->

0 commit comments

Comments
 (0)