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 8160103

Browse filesBrowse files
committed
Update README.md
1 parent bfeb3ab commit 8160103
Copy full SHA for 8160103

File tree

1 file changed

+24
-0
lines changed
Filter options

1 file changed

+24
-0
lines changed

‎README.md

Copy file name to clipboardExpand all lines: README.md
+24Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,4 +402,28 @@ WITH cte AS (
402402
SELECT DISTINCT(num) AS ConsecutiveNums
403403
FROM cte
404404
WHERE num = next AND num = prev
405+
```
406+
407+
408+
[1164. Product Price at a Given Date](https://leetcode.com/problems/product-price-at-a-given-date)
409+
```sql
410+
SELECT product_id, new_price AS price
411+
FROM products
412+
WHERE (product_id, change_date) IN
413+
(
414+
SELECT product_id, MAX(change_date)
415+
FROM products
416+
WHERE change_date <= '2019-08-16'
417+
GROUP BY product_id
418+
)
419+
UNION
420+
421+
SELECT product_id, 10 AS price
422+
FROM products
423+
WHEN product_id NOT IN
424+
(
425+
SELECT product_id
426+
FROM products
427+
WHERE change_date <= '2019-08-16'
428+
)
405429
```

0 commit comments

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