title: PostgresSql throws syntax error on execution
body: <p>I want to update one table by merging three other table based on some condition. losid is  common in all the three tables. My query is as follows:</p>
  
  <pre><code>UPDATE "rpChange"."rpChanget" AS a 
   SET "hold" = CASE  
  WHEN status"."losid" IS NULL  and mUpdate."losid" IS NULL and dealer."losid" IS NULL
   THEN 'N' 
  WHEN (status."losid" IS NOT NULL and COALESCE(age(NOW(), status."updateDt"),age(NOW(), status."createDt")) &lt; '30 minutes'  and status."publishedYN"='Y') or 
  (mUpdate."losid" IS NOT NULL and COALESCE(age(NOW(), mUpdate."updateDt"),age(NOW(), mUpdate."createDt")) &lt; '30 minutes'  and mUpdate."publishedYN"='Y') or 
  (dealer."losid" IS NOT NULL and COALESCE(age(NOW(), dealer."updateDt"),age(NOW(), dealer."createDt")) &lt; '30 minutes'  and dealer."publishedYN"='Y')
   THEN 'Y' 
    END 
   ,"holdR" = CASE  
    WHEN status."losid" IS NULL  and mUpdate."losid" IS NULL and dealer."losid" IS NULL
   THEN NULL 
  WHEN (status."losid" IS NOT NULL and COALESCE(age(NOW(), status."updateDt"),age(NOW(), status."createDt")) &lt; '30 minutes'  and status."publishedYN"='Y') or 
  (mUpdate."losid" IS NOT NULL and COALESCE(age(NOW(), mUpdate."updateDt"),age(NOW(), mUpdate."createDt")) &lt; '30 minutes'  and mUpdate."publishedYN"='Y') or 
  (dealer."losid" IS NOT NULL and COALESCE(age(NOW(), dealer."updateDt"),age(NOW(), dealer."createDt")) &lt; '30 minutes'  and dealer."publishedYN"='Y')
   THEN 'SCHEDULED FOR LATER'
    END 
   FROM "statuss"."statusSt" AS status 
   ,"mUpdates"."mUpdateSt" AS mUpdate
   , "dealers"."dealerSt" AS dealer
   WHERE status."losid" = a."losid" 
   AND mUpdate."losid" = a."losid"
   AND dealer."losid" = a."losid";
  </code></pre>
  
  <p>The above query works before adding COALESCE() ,but after adding  it is throwing syntax error. Can anyone please help me , what am doing wrong here.</p>