Here's what I'm trying to achieve: use a trigger to divide an update query which updates more than 1 columns into several update query and each of the query updates just 1 columns.
For example, the incoming query is:
update table set column_1 = 'a', column_2 = 'b', column_int = 100 where id = 1
I want to use trigger (or is there any other way?) to execute this query in the way:
update table set column_1 = 'a' where id = 1; update table set column_2 = 'b' where id = 1; update table set column_int = 100 where id = 1;
And of course after the three query we don't want to run the original update query (skip it to avoid run the query twice on the table).
Is this possible? The use case is that in MySQL you can update columns in a view, as long as the columns are from just 1 base table. So if I update two columns from different underlying base table MySQL will throw error, hence I want to use trigger to divide them.