在MySQL的where子句中使用BLOB [英] Using BLOB in where clause in MySQL
问题描述
我正在开发一个应用程序,该应用程序需要通过检查存储在MySQL数据库中的指纹来对数据进行一些验证.建议使用诸如"AFIS"之类的专有软件.通过使用select语句的"where"子句中的BLOB列来过滤数据.这可能吗?
I am working on an application that will need to do some verification on data by checking fingerprints stored in a MySQL database.It was proposed to use proprietary software such as 'AFIS'..but i am wondering if the check can be done by using the BLOB column in the "where" clause of a select statement to filter the data. Is this possible?
我想到的代码是这样的:
The code i have in mind is something like this:
Select id from mytable
where image not in
(select image from other table)
图像列为blob数据类型
With the image columns being of blob datatype
推荐答案
您的意思是这样的吗:
SELECT * FROM yourTable WHERE CHAR_LENGTH(your_blob_field) > 0
char_length()适用于Blob列类型...如果该值不是0,那么您知道里面有东西.
char_length() works on a blob column type... if that is anything but 0 then you know you've got something in there.
这篇关于在MySQL的where子句中使用BLOB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!