1

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.

1 Answer 1

5

Wont this work?:

UPDATE `table` SET `data`=  COMPRESS(`data`) WHERE ID > 10 AND ID < 1000
Sign up to request clarification or add additional context in comments.

1 Comment

yup; durh. Obvious answer to obvious problem. Cheers

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.