Fix bug 1071277 - Remove DISTINCT clause