Why do you need the group by clause the row that is coming unwanted check if there is any traling spaces in any of the tables because those record that are equal in both table should not be coming according to the Where clause.