Balajee Venkatesh
Balajee Venkatesh

Reputation: 1099

Finding Substring in Bigquery

How to find substrings in Bigquery? I couldn't find any function which supports firing queries like 'Substring(Column_Name,3,7)'. Is there any way out to achieve the same functionality in Bigquery?

Upvotes: 12

Views: 42130

Answers (2)

user3263743
user3263743

Reputation: 41

You can use substr e.g. substr(Column_Name,3,7)

Upvotes: 0

Mikhail Berlyant
Mikhail Berlyant

Reputation: 172974

#standardSQL
WITH yourTable AS (
  SELECT 'Finding Substring in Bigquery' AS Column_Name
)
SELECT SUBSTR(Column_Name, 9, 12)
FROM yourTable   

So SUBSTR(value, position [, length]) is for you to use

See String Functions for more

Upvotes: 21

Related Questions