18 May 20 ·  nVector in Bigquery ·        Bookmark ·  Report ·  More actions.. Lock comments ·  Pin thread

How to do Case Insensitive Sorting (order by) in Google Bigquery

Bigquery is case-specific. There is no option / setting to make it to ignore case while sorting data in order by clause. Bigquery uses unicode value to order strings. 

The only option is to handle the case differences in the code by adding a UPPER() or NORMALIZE_AND_CASEFOLD function


SELECT * FROM dataset.tablename Order by NORMALIZE_AND_CASEFOLD(ColumnName);


SELECT * FROM dataset.tablename Order by UPPER(ColumnName);


posted on 18 May 20

Enjoy great content like this and a lot more !

Signup for a free account to write a post / comment / upvote posts. Its simple and takes less than 5 seconds