I am using Postgres SQL. I am having multiple tables say table1
, table2
, table3
, table4
, ... with a common column say name
in each of the tables. I want to replace a the value 'Jhon' with 'Jimmy' in every name
column with a single query.
Presently I am using below query:
update table1 set "name" = 'Jimmy' where "name" = 'Jhon';
But I have to run one by one for every table in database. Please suggest a single query which can do the task.