Fixed a bug: the SQL query needed a bit of TLC, so it works correctly all the time and not just some of the time.  (Had trouble with "...WHERE x >= '100%'" cases; turns out, needed to simplify the query to "...WHERE x >= 100")