I have a list of URLs/ Here is an example — www.site.com/product/item1/?utm_source=google&utm_medium=cpc
How I can get all characters before question mark using BigQuery? Sо I want to get www.site.com/product/item1/ from this string.
Thanks a lot!
The easiest way I think is to use SPLIT function as in below example
SPLIT(url, '?')[OFFSET(0)]
As alternative, you can use REGEXP_EXTRACT as in below example
REGEXP_EXTRACT(url, r'[^?]*')
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