How to update two tables using subquery in postgresql?
For example

UPDATE second_table
SET Currentstatus = 1
WHERE EXISTS ( SELECT 1
               FROM first_table
               WHERE first_table.Complaintid = second_table.Parent_complaint_id
                 AND first_table.templateid is not null )


Or

UPDATE second_table
SET Currentstatus = 1
FROM first_table
WHERE first_table.Complaintid = second_table.Parent_complaint_id
  AND first_table.templateid is not null


Or ... too many variants.