Fixing the SQL that retrieves unnotified clients