简体   繁体   中英

Transpose mutiple rows in one column MS access

Looking to transpose data below

3 rows

Order #         Carton       SKU    QTY Date       Hub  PODSTATUS
07232768343200  0           4384173 1   2018/08/13  CRB   X1
07331558939200  13746809    1724640 1   2018/08/19  CRB   X1
07332717287200  13746811    1724640 1   2018/08/19  CRB   X1

to

just one column

07232768343200
0
4384173
1
2018/08/13
CRB
X1
07331558939200
13746809
1724640
1
2018/08/19
CRB
X1
07332717287200
13746811
1724640
1
2018/08/19
CRB
X1

最后结果

any help is appreciated thanks!

RTam

Assuming all your columns are strings, you can use union all :

select order# from t union all
select carton from t union all
. . .

You may need to explicitly convert columns that are not strings.

Note that the results will have no particular order because tables represent unordered sets . You should not depend on the ordering in the result set. If you depend on that ordering, you should have an additional column that specifies the ordering.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM