Please help me with next problem. I have next table:
| Name | Size | DateTime |
|--------|--------|--------------|
| Adi | 120 | 2017-01-26 |
|--------|--------|--------------|
| Mark | 225 | 2017-01-11 |
|--------|--------|--------------|
| Adi | 150 | 2017-01-28 |
|--------|--------|--------------|
| Adi | 115 | 2017-02-01 |
|--------|--------|--------------|
| Adi | 170 | 2017-02-05 |
|--------|--------|--------------|
I need to put one more column with all registrations of each name(if exist), ordereb by DateTime column like this:
| Name | Size1 | Size2 | Size3 |
|--------|-------|-------|-------|
| Adi | 120 | 150 | 115 |
|--------|-------|-------|-------|
I have tried with:
SELECT DISTINCT table.Name, table.Size
FROM database.table AS table
JOIN database.table AS table1
ON table.Name = table.Name
Thank you for your help!