Skip to content
Advertisement

What is wrong with my Postgres statement?

I am trying to select list of employees, but i know some employees do not have manager_id, for these employees without manager_id (null) i want the result to display “pip” while for the rest it displays original info.

Advertisement

Answer

The code you want is probably:

Or more simply:

The two significant issues are:

  • Your CASE syntax is messed up. Either you use comparisons or you have CASE <value>, but not both.
  • Strings are delimited by single quotes.
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement