I have a table like this:
id | userid | commentid | value
-------------------------------
Each user is permitted to vote a comment once. The value can be between -1 and 1. Is there a easy way for a table model to achieve an change of this vote in one single query, without checking EXISTS() first? I already thought about a hash-column like this
MD5(CONCAT(userid, commentid))
but is there any better solution for this?