Is it possible to name the output column created with case (“switch”) in a PostgreSQL SELECT statement? It appears from the documentation that this is not possible. An example usage of what I would like to do is:
SELECT CASE (column) WHEN 1 THEN 'One' END AS 'TheColumn' FROM TABLE ;
It works for me (pg-9.1)
So, the single quotes (that you used to quote the aliased column name) should have been double quotes (or absent).
The result: