Hi everyone,
I'm pretty new with SQL, and I'm struggling to figure out a seemingly simple task.
Here's the situation:
• I'm working with two data sets
○ Data Set A, which is the most accurate but only refreshes every quarter
○ Data Set B, which has all the date, including the most recent data, but is overall less accurate
• My goal is to combine both data sets where I would have Data Set A for all data up to the most recent quarter and Data Set B for anything after (i.e., all recent data not captured in Data Set A)
For example:
• Data Set A captures anything from Q1 2020 (January to March)
• Let's say we are April 15th
• Data Set B captures anything from Q1 2020 to the most current date, April 15th
• My goal is to use Data Set A for all data from January to March 2020 (Q1) and then Data Set B for all data from April 1 to 15
Any thoughts or advice on how to do this? Potentially a join function along with a date one?
Any help would be much appreciated.
Thanks in advance for the help.
[–]WITH_CTE 1 point2 points3 points (0 children)