By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
| Date |
|---|
| 2019-06-01 00:00:00 |
| 2019-06-02 00:00:00 |
| 2019-06-03 00:00:00 |
| player | Date | sporttrainingduration | practiceheldby |
|---|---|---|---|
| AAA | 2019-06-01 | 1 | group1 |
| AAA | 2019-06-02 | 2 | group2 |
| AAA | 2019-06-03 | 3 | group3 |
| AAA | 2019-06-04 | 1 | gorup1 |
| BBB | 2019-06-02 | 2 | group2 |
| CCC | 2019-06-03 | 3 | group3 |
| @sql |
|---|
| max(case when `date`='2019-06-01 00:00:00' then `practiceheldby` end) as `2019-06-01 00:00:00`,max(case when `date`='2019-06-02 00:00:00' then `practiceheldby` end) as `2019-06-02 00:00:00`,max(case when `date`='2019-06-03 00:00:00' then `practiceheldby` end) as `2019-06-03 00:00:00` |
| player | 2019-06-01 00:00:00 | 2019-06-02 00:00:00 | 2019-06-03 00:00:00 |
|---|---|---|---|
| AAA | group1 | group2 | group3 |
| BBB | null | group2 | null |
| CCC | null | null | group3 |