31

How can I search inside Blob column in MySQL for some values ? and Is that possible ?

0

1 Answer 1

37

You should be able to search blobs like other text fields:

SELECT * 
FROM tablename 
WHERE blob_field_name LIKE '%value%'

One thing to notice is that search will be case-sensitive!

Anyway, if possible, it's better to use a TEXT field.

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks a lot, plus I have to use BLOB not TEXT
Just to emphasize when you "Like" search a Blob the search is case sensitive so LIKE '%fred%' is different to LIKE '%Fred%' .
Why is it better to use TEXT? Is BLOB slower to interact with?

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.