Skip to Content
Learning Google BigQuery
book

Learning Google BigQuery

by Thirukkumaran Haridass, Eric Brown
December 2017
Beginner to intermediate
264 pages
5h 38m
English
Packt Publishing
Content preview from Learning Google BigQuery

String Functions

The + operator can be used to concatenate string in legacy SQL but in standard SQL CONCAT function has to be used:

#standardSQLSELECT CONCAT('UNITED',' ','STATES')

The LENGTH function returns the length of the string passed as argument. The following query returns 5 as output:

SELECT LENGTH('INDIA')

The REPLACE function will replace the specified text with the replacement text. The following query will output *****@collegecronista.com this value:

SELECT REPLACE('reachme@collegecronista.com','reachme','*****')

The SPLIT function splits the string by delimiter specified and returns an array of values. The output of the query is shown in the following screenshot:

#standardSQLSELECT SPLIT('1,2,3,4,5,6',',')
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Google BigQuery: The Definitive Guide

Google BigQuery: The Definitive Guide

Valliappa Lakshmanan, Jordan Tigani
Google BigQuery Analytics

Google BigQuery Analytics

Siddartha Naidu, Jordan Tigani

Publisher Resources

ISBN: 9781787288591Supplemental Content