I would like to implement in BigQuery the same function I can find in stringr (R package) - as str_starts()
I would like to filter a table for all the string rows starting with "Sport - ".
I use the expression LIKE but I am not sure it works correctly...
SELECT *
FROM table_1
WHERE string LIKE '%Sport - %'
You can use REGEXP_CONTAINS on your where clause
SELECT * FROM table WHERE REGEXP_CONTAINS(Team,r'^Sport\s-\s')
Reference: https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_contains
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With