Conditional expression in an UPDATE statement - Mailing list pgsql-sql

From JORGE MALDONADO
Subject Conditional expression in an UPDATE statement
Date
Msg-id CAAY=A7_J_=RH5Uy2DhkAB6TuSPxwqG97CKYWr6FPmrgAWxu-3A@mail.gmail.com
Whole thread Raw
List pgsql-sql
Can I use a conditional expression in an UPDATE query like this:

UPDATE table_1 SET
field_1 =
CASE WHEN (condition) THEN (COALESCE(query_1, -1))
          ELSE (COALESCE(query_1, -2))
END

With respect,
Jorge Maldonado

pgsql-sql by date:

Previous
From: JORGE MALDONADO
Date:
Subject: Re: Setting a default value for a select statement without results
Next
From: Jasen Betts
Date:
Subject: Re: Conditional expression in an UPDATE statement