RAAPereira
RAAPereira

Reputation: 49

Pivot data to gridview

I looked around for some time now and can't find an answer that fits my issue.

How can I pivot this table (see sample file) to show in Cgridview?

id_assistente(INT)|id_data(date)|id_horario(INT)|
|1                |2017-01-01   |1              |
|1                |2017-01-02   |2              |
|1                |2017-01-03   |3              |
|1                |2017-01-04   |3              |
|...              |...          |...            |
|2                |2017-01-01   |1              |
|2                |2017-01-02   |2              |
|2                |2017-01-03   |3              |
|2                |2017-01-04   |3              |
|...              |...          |...            |

I need it do display as:
id_assistente(INT)|2017-01-01|2017-01-02|2017-01-03|2017-01-04|...
1                 |1         |2         |3         |3         |...
2                 |1         |2         |3         |3         |... 

Sample DB

Upvotes: 0

Views: 140

Answers (0)

Related Questions