I know how to hash values in each row of the result set< /p>
For example, SELECT md5(‘something’)
But say I have a similar query
SELECT * FROM `some_table`< /pre>And the result set contains many rows, can the whole result set be hashed into one value?
I should be clear, I don’t want each row to have a hash value. I want a hash value of the entire result set.
That is, one has the whole set.
Edit: Make the requirements clearer.
SELECT MD5(GROUP_CONCAT(CONCAT(col1,col2,...))), 1 as g
FROM some_table GROUP BY g; pre>
Is it possible to apply the hash function to the entire result set in mysql.
I know how to hash in each row of the result set Value
For example, SELECT md5('something')
But say I have a similar query
SELECT * FROM `some_table `
And the result set contains many rows, is it possible to hash the entire result set into one value?
I should be clear, I don’t want each row to have a hash value. I want a hash value of the entire result set.
That is, one has the whole set.
Edit: Make the requirements clearer.
Combine CONCAT() and GROUP_CONCAT():
p>
SELECT MD5(GROUP_CONCAT(CONCAT(col1,col2,...))), 1 as g
FROM some_table GROUP BY g;