I am looking for a method that extracts the dates of Result 2, add to be columns of Result 1, final as Expect result.
After Googled, I tried to use transform but mess result. How could I build the result? Thanks.
Result 1:
merchantRef | totalAmount | country |
---|---|---|
1 | 10 | UK |
2 | 20 | UK |
3 | 60 | UK |
SELECT tblThree.merchantRef, tblThree.inDate
FROM tblThree;
Result 2 (tblThree):
merchantRef | inDate |
---|---|
1 | 12/21/2010 |
2 | 02/28/2021 |
3 | 06/15/2021 |
3 | 07/15/2021 |
Expect result:
merchantRef | totalAmount | country | inDate | inDate2 |
---|---|---|---|---|
1 | 10 | UK | 12/21/2010 | |
2 | 20 | UK | 02/28/2021 | |
3 | 60 | UK | 06/15/2021 | 07/15/2021 |