Given such table:
+-----------+-----------+-----------+-----------+
| id | A | B | C |
+-----------+-----------+-----------+-----------+
| 100 | 1 | NULL | NULL |
+-----------+-----------+-----------+-----------+
| 101 | NULL | 2 | NULL |
+-----------+-----------+-----------+-----------+
| 102 | NULL | NULL | 3 |
+-----------+-----------+-----------+-----------+
| 103 | 4 | NULL | NULL |
+-----------+-----------+-----------+-----------+
| 104 | NULL | NULL | 5 |
+-----------+-----------+-----------+-----------+
Is there a way to make a query which combines the multiple rows into one to avoid empty fields?
Example result:
+-----------+-----------+-----------+
| A | B | C |
+-----------+-----------+-----------+
| 1 | 2 | 3 |
+-----------+-----------+-----------+
| 4 | NULL | 5 |
+-----------+-----------+-----------+
To notice how:
- Each row contains only one value for the fields (and so A or B or C)
- There isn't a field which can help grouping all fields of an entry
- An entry can have a different number of fields (an entry could have A, B and C as fields, while another could have only A and C or similar).
Not sure if anything can be done about this?
Any suggestion is really appreciated!