1

I'm newest newbie to Database and learning to use MySQL.
I want to cut the data by every 10 row, and paste it to new columns.
Function of "Partition" seems available in these situation, but I can't figure out how it works.
Just to want to know way convenient than cut and paste in Excel..

(Please take a look at pictures : http://doremifafa.egloos.com/1147359)

Data to Revise:


(source: egloos.com)

I want it to look like this:

http://thumbnail.egloos.net/600x0/http://pds21.egloos.com/pds/201310/07/05/f0238705_5252617b8c1f4.png

4

1 回答 1

0

当我查看您的图片时,您似乎想要做相反的事情,即从不同的列中获取值并将它们“粘贴”到彼此下方以创建很多行并且只有两列。那正确吗?

如果是这样,您可以这样做(使用虚拟 Col1、2、3 字段,因为我不知道您的实际列名和表名)。

select 
  Col1, Col2, Col3 
from 
  YourTable 
union all
select 
  Col4, Col5, Col6 
from 
  YourTable 
union all
select 
  Col7, Col8, Col9 
from 
  YourTable 
...
于 2013-10-07T07:08:43.877 回答