I have 2 tables say:
Orders:
id | Name | Amount | Date
1 | ABC | 100 | 2020-10-01
2 | XYZ | 200 | 2020-10-01
3 | MNO | 250 | 2020-11-01
Order_details:
id | Item | Qty
1 | A | 2
1 | B | 1
1 | C | 3
2 | X | 1
3 | A | 4
Now I want to fetch the data using the date on which the order was made.
Say if I want to fetch the data of 2020-10-01 the output should be something like this:
id | Name | Amount | Date | Item1 | Qty | Item2 | Qty ...
1 | ABC | 100 | 2020-10-01 | A | 2 | B | 1
2 | XYZ | 200 | 2020-10-01 | X | 1
I tried to fetch it using a subquery, but I was not sure how to print that data.
Thanks in advance!