How to Use the SQL Label clause in Google Sheets Query

The SQL Label clause in Google Sheets Query allows you to give an alias, or name, to a column in your query so that the output is easier to understand and more organized. It can also make the query easier to read, as the alias can be used in the query instead of the full column name. Using the Label clause is especially helpful when using complex queries involving multiple tables and columns.


You can use the label clause in a Google Sheets query to create specific labels for the results of certain columns.

You can use the following syntax to create a specific label for one column within a query:

=QUERY(A1:C13, "select * label A 'Column A'")

In this example, we select all columns in the range A1:C13 and we label column A as ‘Column A’ in the resulting output.

You can also use the following syntax to create specific labels for multiple columns within a query:

=QUERY(A1:C13, "select * label A 'A Column', B 'B Column'") 

The following examples show how to use these formulas in practice.

Example 1: Use Label Clause with One Column

We can use the following formula to select the Team, Points, and Rebounds columns, then label the ‘Team’ column as ‘Team Name’ in the output:

label clause in Google Sheets

Notice that the ‘Team’ column has been renamed, but the ‘Points’ and ‘Rebounds’ columns retained their original names.

Example 2: Use Label Clause with Multiple Columns

We can use the following formula to select the Team, Points, and Rebounds columns, then label the ‘Team’ column as ‘Team Name’ and ‘Points’ column as ‘Points Scored’ in the output:

In this example, we used the label clause to rename two columns in the output but we can use this exact same syntax to rename any number of columns that we’d like.

The following tutorials explain how to perform other common operations with Google Sheets queries:

Google Sheets Query: How to Use Group By

x