I'm trying to add records into a result dynamically if they don't exist and preserve the order. How would one go about adding additional values and making sure a record exists for [Foreign ID] | [Date] | [ID]?
For example if I do a select how can I guarantee that I will always have [ID] 1,2,3,4,5 in for all existing [Foreign ID] | [Date]? I found a related article however it's for postgress. It looks like I will need to understand and use coalesce.
**Schema**
[Foreign ID] | [Date] | [ID] | [Name]
Results...
11 | 2020-02-02 00:00:00.000 | 1 | 'Bob'
11 | 2020-02-02 00:00:00.000 | 2 | 'Alice'
12 | 2020-02-02 00:00:00.000 | 1 | 'Bob'
12 | 2020-02-02 00:00:00.000 | 2 | 'Alice'
13 | 2020-02-03 00:00:00.000 | 1 | 'Bob'
14 | 2020-02-03 00:00:00.000 | 2 | 'Alice'
15 | 2020-02-03 00:00:00.000 | 1 | 'Bob'
16 | 2020-02-03 00:00:00.000 | 2 | 'Alice'