更改Query()函数中特定列中所有单元格的文本

时间:2019-11-19 15:21:34

标签: arrays google-sheets google-sheets-formula google-sheets-query google-query-language

我有以下查询来组合Google电子表格中的三个标签:

=QUERY({'Stock 1'!A:N;'Stock 2'!A2:N;'Stock 3'!A2:N};"Select Col1, Col2, Col3, Col4 Where Col3<>''";1)

在分组的选项卡(总库存)中,我要将D列(Col4)的所有单元格更改为“公司1”

SQL中是否有类似于“ set”的功能?

示例:

https://docs.google.com/spreadsheets/d/1zGaka_DK5SPeRE-LAB7pK7NJ6I9bRUx4G6cgb_4inGg/edit#gid=2081907934

2 个答案:

答案 0 :(得分:1)

尝试:

=QUERY({'Stock 1'!A:D; 'Stock 2'!A2:D; 'Stock 3'!A2:D}; "where Col1 is not null"; 1)

0


或:

=QUERY({'Stock 1'!A:D; 'Stock 2'!A2:D; 'Stock 3'!A2:D}; 
 "select Col1,Col2,Col3,'Company X' where Col1 is not null label 'Company X''Company'"; 1)

0

答案 1 :(得分:0)

代替

"Select Col1, Col2..., Col12 Where Col9<>''"

只放

"Select Col1, Col2..., 'Company X' Where Col9<>''"