Avoid duplicate common names by using DISTINCT ON