Select distinct on blob

2020-04-11 11:53发布

问题:

Is there a way to verify if the value in blob in more rows is identical in the Oracle database? The blob is the same column.

I have the size of the blob stored in another column but I need to know if the value is equal too.

The value stored is a serialized object.

回答1:

I would recommend adding another column which contains the hash of the blob value. When you store the blob you also calculate the hash value, using SHA256 for example, and store that. When you later want distinct values you just use this new column.