Question
I have got 3 tables:
Calendar
Customer
Id Date 1 1/1/2018 2 2/1/2018 3 3/1/2018
Id Name 1 Matthew 2 Jake 3 Els
Reservation type
Id Reservation Type 1 AM 2 PM 3 D
Now I got a query that populates a table that show per date which customer has which type of reservation, resulting in table:
Id CalendarId CustomerId ReservationTypeId 1 1 1 1 2 1 2 1 3 1 3 3 4 2 1 1 5 2 2 2 6 2 3 1 7 3 1 3 8 3 2 2 9 3 3 1
Question:
How to make the query that lists the dates (group by) and then shows a column per Customer and the values should show the type of reservation. For the example above, the result should be:
Date Matthew Jake Els 1/1/2018 AM AM D 2/1/2018 AM PM AM 3/1/2018 D PM AM
Thank you in advance.
Kind regards,
Bart