I've seen a couple cases where this error occurs:
!=
in a where
clause with a list of multiple or
valuessuch as:
where columnName !=('A'||'B')
This can be resolved by using
where columnName not in ('A','B')
if()
function:select if(col1,col1,col2);
in order to select the value in col1
if it exists and otherwise show the value in col2
...this throws the error; it can be resolved by using:
select if(col1!='',col1,col2);