tags:

views:

548

answers:

2

I want to remove duplicate rows return from a SELECT Query in Postgres

I have the following query

SELECT DISTINCT name FROM names ORDER BY name

But this somehow does not eliminate duplicate rows?

+1  A: 

PostgreSQL is case sensitive, this might be a problem here DISTINCT ON can be used for case-insensitive search (tested on 7.4)

SELECT DISTINCT ON (upper(name)) name FROM names ORDER BY upper(name);
ymv
Thx , this now works
Roland
A: 

Maybe something with same-looking-but-different characters (like LATIN 'a'/CYRILLIC 'а')

ymv