I have multiple tables "100+", with the exact similar structure, yes I know I probably should not have it this way but it is what it is now.
What I want to do is, update all tables in one query without having to specify the table to each field.
update table1,table2,tableN set field1 = "value" WHERE id = 1;
This of course throws an error "field1 is ambiguous", so I could do it like so:
update table1,table2 set table1.field1 = "value", table2.field1 = "value" WHERE table1.id = 1 AND table2.id = 1;
While this works, I'd rather not have a query that has 100+ table names and 100+ "ands" in the condition statements, I don't even know what's the limit on this thing.
Assuming there is no other way to do it, would it be better performance-wise, to loop through tables names and perform 100 queries instead?