Reputation: 61
If there a one-shot way to update a range of IDs (e.g. WHERE ID
>10 AND ID
<1000) to compress a blob column (e.g. data
)?
e.g.
UPDATE `table` SET `data`=(SELECT COMPRESS(`data`) FROM `table` WHERE ID=1) WHERE ID=1
but for a range of IDs instead of a single ID. I need to update around 1500 rows that were incorrectly inserted into a DB without compression.
Upvotes: 1
Views: 1106
Reputation: 10880
Wont this work?:
UPDATE `table` SET `data`= COMPRESS(`data`) WHERE ID > 10 AND ID < 1000
Upvotes: 5