将BLOB与Oracle数据库中的其他BLOB进行比较 [英] Compare BLOB against other BLOBs in Oracle database

查看:702
本文介绍了将BLOB与Oracle数据库中的其他BLOB进行比较的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检查数据库中是否存在blob的重复项.我的数据库中有文档表,但是我不确定如何检查其中一个是否重复.我知道您应该使用dbms_lob.compare函数,但是在阅读了有关该主题的一些线程和文章之后,我仍然不明白这一点.

How to check if there is a duplicate of a blob in a database. I have documents table in the database, however I'm not sure how to check if one of them has a duplicate. I know you're supposed to use dbms_lob.compare function but after reading a few threads and articles on the topic I still do not understand this.

Documents表具有document_id列和data(blob)列.我怎么可能检查document_id = 1是否重复?

Documents table has document_id column and and data(blob) column. How can I possibly check if document_id = 1 has a duplicate?

推荐答案

查看其他类似的答案,

See other similar answers, like this one. "If dbms_lob.compare(lob1, lob2) = 0, they are identical."

select *
from documents dup
join documents orig on orig.document_id = 1
    and dup.document_id <> orig.document_id
where dbms_lob.compare(orig.blob, dup.blob) = 0;

这篇关于将BLOB与Oracle数据库中的其他BLOB进行比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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