Skip to content
Advertisement

Use of right in standard SQL in BigQuery

While running the following code in standard SQL in BigQuery, I’m getting an error stating

#standardSQL
UPDATE dataset.dataset
SET New_column = RIGHT(link_id, LEN(link_id) - 3)
WHERE TRUE


Error: Syntax error: Unexpected keyword RIGHT at [8:18]

Advertisement

Answer

You can use substr() instead :

. . .
set New_column = substr(link_id, 4)
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement