Updating query to handle the new requirements that we won't delete any trials.