I tried a lot, but I cannot figure out a way to do this:

I have a table with (not unique) IDs and dates. All entries should be selected in the end, but they need to be sorted.

Table:

```
+----+------------+
| id |    date    |
+----+------------+
|  1 | 2017-12-10 |
|  1 | 2015-05-22 |
|  7 | 2016-04-05 |
|  2 | 2017-12-12 |
|  2 | 2014-03-10 |
|  7 | 2016-01-14 |
|  1 | 2016-08-17 |
+----+------------+

```

What I need:

```
+----+------------+
| id |    date    |
+----+------------+
|  2 | 2017-12-12 |
|  2 | 2014-03-10 |
|  1 | 2017-12-10 |
|  1 | 2016-08-17 |
|  1 | 2015-05-22 |
|  7 | 2016-04-05 |
|  7 | 2016-01-14 |
+----+------------+

```

I need everything "grouped" by the ids, starting with the id that has the most recent date linked to it.

```
id: 2 / date: 2017-12-12

```

has the most recent date, so now all rows with Id 2 follow, ordered by the date descending. After that, which "block" of ids comes next is determined again by the next most recent date and so on.