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

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.

James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.

Share this article
Twitter Facebook Pinterest