I have a table tbl_a, with “ID” as a primary key, with columnns “A1″,”B1″,”A2″,”B2”
I’d like to make an update query that updates ID as:
A1 = B1 and A2 = B2
so that if the table was
ID| A1| A2| B1| B2
-------------------
7 | 0 | 0 | 5 | 3
after the update:
ID| A1| A2| B1| B2
---------------
7 | 5 | 3 | 5 | 3
Is that possible to do on one query?
Seems as simple as
Naturally if you want to do it for only the row with ID=7 you can do
Demo here.