Created
February 5, 2023 16:51
-
-
Save achad4/6bf4ff63707d381863b5e9b8b6da2a29 to your computer and use it in GitHub Desktop.
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
/* | |
purchase table example | |
transaction_date | customer_id | purchase_price | category | |
2022-01-01 customer_A $10 jewelry | |
2022-01-02 customer_A $1 t-shirts | |
... | |
2022-01-31 customer_A $5 t-shirts | |
*/ | |
SELECT transaction_date, purchase_price | |
FROM purchase p | |
WHERE | |
customer_id = <customer_A> | |
AND date > CURRENT_DATE - INTERVAL '30 DAYS' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment