Finding Substring in Bigquery

孤人 提交于 2020-02-27 22:40:55

问题


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?


回答1:


#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




回答2:


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



来源:https://stackoverflow.com/questions/46209955/finding-substring-in-bigquery

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!