Decode equivalent in postgres
There is an equivalent. It’s called a CASE statement. There are two forms of CASE: Simple CASE: CASE search-expression WHEN expression [, expression [ … ]] THEN statements [ WHEN expression [, expression [ … ]] THEN statements … ] [ ELSE statements ] END CASE; Searched CASE: CASE WHEN boolean-expression THEN statements [ WHEN … Read more