how to write a case expression with Postgres? I have this
case
when rc.stat = 0 Then unpaid
when rc.stat = 1 Then paid
when rc.stat = 2 Then dispute
else rc.stat
end
but when I go to run the statement I get an error of
Error: column "unpaid" does not exist
I have also tried double quotes and brackets around the text values, but all of those options give me errors. Just to note, the values unpaid, paid, dispute are NOT fields in the database, but text values I want to write.