Skip to content
Advertisement

Syntax error for nested condtionals in SQL

I’m pretty new to redshift and I’ve been trying to to do a nested case when condition here, yet I get a syntax error

ERROR: syntax error at or near “)”

in this line of SQL:

I’m not sure what’s wrong, since I’m familiar with Python and I’m pretty sure this is how nested conditions work

Advertisement

Answer

You should end the nested CASE, like that:

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement