ilike expression support in bigquery

BigQuery throws an error when 'ilike' expression is used. What is the alternative for doing case insensitive like query?

Below is the relevant part of the query.

SELECT id FROM `performance_last30days` WHERE device ilike 'DESKTOP'
Syntax error: Expected ")" but got "ilike" 

1 Answer

SELECT id
FROM `performance_last30days`
WHERE UPPER(device) LIKE '%DESKTOP%'

or

SELECT id
FROM `performance_last30days`
WHERE REGEXP_CONTAINS(device, r'(?i)DESKTOP')
2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like