mySQL: get hash value for each row?

前端 未结 5 1800
长发绾君心
长发绾君心 2021-01-04 07:00

Currently I\'m manually creating a string where I concatenate all the values in each row in my table. I\'m hashing this string for each row to get a hash value for the curre

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-04 07:56

    you could do something like

    SELECT MD5(concat(field1, field2, field3, ...)) AS rowhash
    

    but you can't get away from listing which fields you want, as concat(*) is not an option (syntax error).

提交回复
热议问题