I have a table like
Name | Total | Date |
---|---|---|
A | 10 | 2020-12-01 |
B | 5 | 2020-12-01 |
A | 10 | 2020-12-02 |
B | 15 | 2020-12-02 |
now I have a List of Name and Date List Like
@NameList = '[A],[B],[C],[D]'
@DateList = '[2020-12-01],[2020-12-02],[2020-12-03],[2020-12-04]'
How to query to fetch data for each name and date available in @NameList
and @DateList
?
Expected Result
Name | Total | Date |
---|---|---|
A | 10 | 2020-12-01 |
B | 5 | 2020-12-01 |
C | 0 | 2020-12-01 |
D | 0 | 2020-12-01 |
A | 10 | 2020-12-02 |
B | 15 | 2020-12-02 |
c | 0 | 2020-12-02 |
D | 0 | 2020-12-02 |
A | 0 | 2020-12-03 |
B | 0 | 2020-12-03 |
c | 0 | 2020-12-03 |
D | 0 | 2020-12-03 |
A | 0 | 2020-12-04 |
B | 0 | 2020-12-04 |
c | 0 | 2020-12-04 |
D | 0 | 2020-12-04 |