Postgresql Find Duplicate Values In R