Fix ambiguity in SQL query.