Skip to content

Commit 7a7e5b8

Browse files
committed
Update README.md
1 parent 14e106c commit 7a7e5b8

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

+14
Original file line numberDiff line numberDiff line change
@@ -544,4 +544,18 @@ CASE WHEN MOD(id,2)=0 THEN (LAG(student) OVER (ORDER BY id))
544544
ELSE (LEAD(student, 1, student) OVER (ORDER BY id))
545545
END AS 'Student'
546546
FROM Seat
547+
```
548+
549+
[1327. List the Products Ordered in a Period](https://leetcode.com/problems/list-the-products-ordered-in-a-period/)
550+
```sql
551+
-- name, amt
552+
-- >= 100 units, feb 2020
553+
554+
SELECT p.product_name, SUM(o.unit) AS unit
555+
FROM Products p
556+
LEFT JOIN Orders o
557+
ON p.product_id = o.product_id
558+
WHERE DATE_FORMAT(order_date, '%Y-%m') = '2020-02'
559+
GROUP BY p.product_name
560+
HAVING SUM(o.unit) >= 100
547561
```

0 commit comments

Comments
 (0)