Is it possible to have a whole result set in MySQL?

Is it possible to apply a hash function to the entire result set in mysql.

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.

Combine CONCAT() and GROUP_CONCAT():

SELECT MD5(GROUP_CONCAT(CONCAT(col1,col2,...))), 1 as g
FROM some_table GROUP BY g;

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():

SELECT MD5(GROUP_CONCAT(CONCAT(col1,col2,...))), 1 as g
FROM some_table GROUP BY g;

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 3003 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.