I have a SQL question.
I have two tables: tableA and tableB. These two tables has exactly the same structure (simplified version):
rowid : big int
name: character varying
enabled : boolean
The two table:
tableA contains all the data and their enabled columns are all true.
tableB contains data in tableA that should be turned off (enabled set to false).
My question is that how can I write a SQL statement that replacing all the rows in tableA with the row in tableB (or similarly, set the enabled field to false for all the rows that exists in tableB)
I use PostgreSQL. SQL statement from other SQL types are also welcome.
Many thanks.
There are many ways to achieve this.
Try: