LENGTH function in BigQuery
In SQL, the LENGTH function is used to return the length of a string. This length is measured in characters.
SQL Syntax
SELECT LENGTH(string_column) FROM table_name;
Example: Calculate the length of the subscriber_type column.
SQL
SELECT trip_id, subscriber_type, LENGTH(subscriber_type) AS Length_of_the_column FROM `bigquery-public-data.austin_bikeshare.bikeshare_trips`;
The result of the above query is shown below:
