Sql Getting Rid Of Duplicates In Python