title: mysql: Select data from table and group by time slot
body: <p>I have a table consisting of appointments with date, time and a participant.</p>
  <p>I now need to select all data from this table and <strong>group it by time slot</strong>, so I can see which appointments are set to which date.
  There can be <em>multiple</em> participants for one time slot.</p>
  <p><strong>table appointments:</strong></p>
  <pre><code>+-----------------+--------+--------------------+
  | id | date       | time   | participant        |
  +-----------------+--------+--------------------|
  | 1  | 2020-01-05 | 08:00  | John Doe           |
  | 2  | 2020-01-05 | 08:30  | Steve Jobs         |
  | 3  | 2020-01-05 | 08:30  | Max Mustermann     |
  | 4  | 2020-02-05 | 11:00  | John Wayne         |
  | 5  | 2020-03-05 | 11:00  | Martina Mustermann |
  +-----------------+--------+--------------------+
  </code></pre>
  <p>I now need to find the query to get a result like this:</p>
  <pre><code>2020-01-05 - 08:00
  - John Doe
  
  2020-01-05 - 08:30
  - Steve Jobs
  - Max Mustermann 
  
  2020-02-05 - 11:00
  - John Wayne
  
  2020-03-05 - 11:00
  - Martina Mustermann
  </code></pre>
  <p>Of course the result doesn't have to be formatted like this, it's enough for me to find the query itself. Then I'll be able to use php to create an array out of it.</p>
  <p>Thank you in advance!</p>