我有下面的sql查询,需要在bigquery上运行
select replace(substring(p.name, charindex(',', p.name), len(p.name)), ',', '') AS [First_Name] from people p
所以我尝试了下面的大查询语法
select replace(SUBSTR(p.name, charindex(',', p.name), len(p.name)), ',', '') AS [First_Name] from people
但我的错误率越来越低
Function not found: charindex at [1:1]
1条答案
按热度按时间oaxa6hgo1#
bigquery的字符串操作功能比sqlserver强大得多。更简单的方法是:
也可以使用正则表达式: