8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bfeb3ab commit 8160103Copy full SHA for 8160103
README.md
@@ -402,4 +402,28 @@ WITH cte AS (
402
SELECT DISTINCT(num) AS ConsecutiveNums
403
FROM cte
404
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
423
+WHEN product_id NOT IN
424
425
+ SELECT product_id
426
427
428
429
```
0 commit comments