Home > Enterprise >  How to add extra column to query result
How to add extra column to query result

Time:08-28

I'd like to add one extra column with same text "Toys" to query result.

in the Cell G2, I want the query to be like this:

​ " select *, 'Toys' label 'Toys' 'Product Type' "

This is the expected result I want to display:

enter image description here

CodePudding user response:

You'll need to list all the columns explicitly for that. SELECT *, 'toys' construction does not work in Google Sheets QUERY().

=QUERY(A1:B8,"SELECT A, B, 'Toys' label 'Toys' 'Product Type'")

enter image description here

CodePudding user response:

Try this

=QUERY(A1:C11,"label A 'Items', B 'Price', C 'Product Type' ")

(Adjust the formula according to your ranges and locale)

  • Related