We would like to run a query that returns no of character in the given string if i have a string say : Baitul Sharaf, 105 Hill Road, Bandra (west), Mumbai I want to count no of ',' in the above string (In above case 3)
see the reference for my question Count the number of occurrences of a character in a string in Javascript I want to achieve the same in BigQuery
SELECT LENGTH(col) - LENGTH(REGEXP_REPLACE(col, ',', '')) FROM TableName
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