Created
August 26, 2021 19:31
-
-
Save DeBraid/f1051aa40ef0b4805179973d19a0830f to your computer and use it in GitHub Desktop.
PSQL: get most recent inventory given product ids
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
createdon | |
FROM | |
inventory | |
WHERE | |
productid in( | |
SELECT | |
id FROM product | |
WHERE | |
verified = FALSE | |
AND iscannabis = TRUE | |
ORDER BY | |
createdon DESC) | |
AND createdon > now() - interval '4 hours'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment