How can I select just one row from a table with the same value in multiple rows?