troubleshooting Question

mysql: convert 2 bytes from blob to integer

Avatar of cleaverX
cleaverX asked on
MySQL Server
2 Comments1 Solution2714 ViewsLast Modified:

I have a BLOB field and i want to take 2 bytes from it and use them as an integer.  How can i do this?  

select substr(blobfield,195,2) as value1 from mytable;

the 2 bytes on position 195 and 196 are an integer that was stored inside a blob field.

How can i get the integer back in mysql, so i can perform a where / having on this value ?

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros