我有以下查询来组合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”的功能?
示例:
答案 0 :(得分:1)
尝试:
=QUERY({'Stock 1'!A:D; 'Stock 2'!A2:D; 'Stock 3'!A2:D}; "where Col1 is not null"; 1)
或:
=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)
答案 1 :(得分:0)
代替
"Select Col1, Col2..., Col12 Where Col9<>''"
只放
"Select Col1, Col2..., 'Company X' Where Col9<>''"