简体   繁体   中英

Update MySQL DB to Compress Blobs

If there a one-shot way to update a range of IDs (eg WHERE ID >10 AND ID <1000) to compress a blob column (eg data )?

eg

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.

这项工作无效吗?:

UPDATE `table` SET `data`=  COMPRESS(`data`) WHERE ID > 10 AND ID < 1000

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM