需要在MYSQL中将列转换为行

时间:2017-02-23 06:23:20

标签: mysql

我有以下样本数据

------------------------------|------|-
Sishya School                 |  3   | 
------------------------------|------|--
Chettinad Vidhyashram         |  2   |
------------------------------|------|--
Asan Memorial School          |  8   |
------------------------------|------|--
Maharishi Vidhya  Mandir      |  1   | 
------------------------------|------|--
PSBB Memorial School          |  4   |
------------------------------|------|--
D.V.S Public School           |  2   |
------------------------------|------|--
St.Mary’s School              |  5   | 
------------------------------|------|--

我想将列转换为Rows,以便表格如下所示,

---------|----------------|-----------|-----------|---------|---------|-------
Sishya   |     Chettinad  |   Asan    |  Maharishi| PSBB    |   D.V.S |St.Mary’s
School   |    Vidhyashram |   Memorial|  Vidhya   | Memorial|   Public| School 
         |                |    School |  Mandir   |  School |   School|
---------|----------------|-----------|-----------|---------|---------|-------
         |                |           |           |         |         | 
3        |        2       |      8    |       1   |       4 |      2  |     5
---------|----------------|-----------|-----------|---------|---------|---------                                            

请帮我解决问题。

0 个答案:

没有答案