[thelist] Increment every value in table (MySQL)

Jason Handby jason.handby at corestar.co.uk
Tue Jan 6 07:40:08 CST 2009

> Thanks
> but I am looking for a query something like UPDATE table_name SET * =
> x 1.35 so I don't need to know field names.

If *every* value in the table is multiplied by 1.35, that means anything
else that references this table will have its foreign key relationship
broken (as for every record in your table the primary key will change).

So, you'll need to either a) exclude some fields in your table from the
multiplication (e.g. if you have a numeric ID field) or b) carry out the
same multiplication process on the relevant fields in any other table
that refers to this one, so that the reference is preserved. Either way
your database structure sounds a bit weird :-)


More information about the thelist mailing list