Created
November 24, 2021 17:46
-
-
Save Mr--John-Doe/95939acc0207dc77f4bfdb5bb77a91e0 to your computer and use it in GitHub Desktop.
How To Do For Loops in SQL
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
FOR p_date in DATE_LIST: | |
INSERT INTO result | |
SELECT p_date, ... | |
FROM ... JOIN ... | |
WHERE dt between trunc('month', p_date) and p_date | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment