I just can\'t logically think how to do this without doing multiple queries, which I\'d like to avoid if possible. I have a mysql table set up like this.
+------+