Microsoft SQL Server CHARINDEX function equivalent in Bigquery

CHARINDEX function in Bigquery


STRPOS is the equivalent for CHARINDEX function in Bigquery. While migrating the code from Microsoft SQL Server you will need to rewrite this function in Bigquery

CHARINDEX function Conversion Examples


CHARINDEX function in Microsoft SQL Server

select charindex('uzzy', 'fuzzy wuzzy', 1);

+-------------------------------------+
| CHARINDEX('UZZY', 'FUZZY WUZZY', 1) |
|-------------------------------------|
|                                   2 |
+-------------------------------------+

CHARINDEX function equivalent in Bigquery

select STRPOS( 'fuzzy wuzzy', 'uzzy');

+-------------------------------------+
| STRPOS( 'FUZZY WUZZY', 'UZZY') |
|-------------------------------------|
|                                   2 |
+-------------------------------------+

Try our Free Online Converter for Bigquery


Roboquery converts this function and lot of other unsupported datatypes, functions, statements & operators in just a click. Its fast, free and secure. Give it a try now

Convert to Bigquery