比较 SQL 中的图像 [英] Compare Images in SQL

查看:43
本文介绍了比较 SQL 中的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

与数据库中的图像进行比较的最佳方法是什么?我试着比较它们(@Image 是 Image 类型):

What is the best way to compare to Images in the database? I tried to compare them (@Image is the type Image):

Select * from Photos 
where [Photo] = @Image

但收到错误数据类型图像和图像在等于运算符中不兼容".

But receives the error "The data types image and image are incompatible in the equal to operator".

推荐答案

由于 Image 数据类型是用于存储数据的二进制和巨大空间,IMO,比较 Image 字段的最简单方法是哈希比较.所以你需要在你的表上存储 Photo 列的哈希值.

Since the Image data type is a binary and huge space for storing data, IMO, the easiest way to compare Image fields is hash comparison. So you need to store hash of the Photo column on your table.

这篇关于比较 SQL 中的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆