mardi 26 janvier 2021

Error on an IF function format SQL: Error Not Supported BOOL, STRING, BOOL, only IF(BOOL, ANY, ANY)

I'm trying to write an IF statement in SQL, and it's throwing an error about the supported format

SQL_ANALYSIS_ERROR: No matching signature for function IF for argument types: BOOL, BOOL, STRING. Supported signature: IF(BOOL, ANY, ANY)

Code: IF(field1 = 'string_1', field2, 'string_2') AS field1

This should meet the requirement of BOOL, ANY, ANY....but for whatever reason it's not. Anyone have suggestions? Or am I missing something?

Aucun commentaire:

Enregistrer un commentaire