问题
I have this table (as an example)
id | a | b | c
1 | 23 | 13 | 56
2 | 67 | 45 |
3 | 43 | |
4 | 78 | 34 | 45
I want to upload transpose that using the query statement so that I can upload it to my database, the result should look like:
1 | 23
1 | 13
1 | 56
2 | 67
2 | 45
3 | 43
4 | 78
4 | 34
4 | 45
How would I do that?
回答1:
Assuming you have the data in A:D, try:
=ArrayFormula({transpose(split(query(rept(A:A&" ", if(len(B:B), countif(if(not(isblank(B:D)), row(B:B)), row(B:B)),)),,50000)," ")),transpose(split(join(" ",query(transpose(B:D),,50000)), " "))})
来源:https://stackoverflow.com/questions/30354693/google-query-spreadsheet-reverse-transpose