[postgis-users] Compare two rows in one table ?

Maxime van Noppen maxime at altribe.org
Wed Sep 23 07:33:25 PDT 2009


Tuomas Ruohonen wrote:
> Compare two rows in table, when result changes more than 2 query shows 
> only those rows. In this case query ignores 25,25,25,24,23 and shows 
> only 26,24 and 21. There should be always one number only if the number 
> is same, like 24 and 24, shows only one 24.
> Is this even possible ? I hope you can understand what i mean in this 
> case...

I believe this should be be more appropriate in the postgresql user list.

Btw, the answer to your question is quite easy. Look at the 'DISTINCT' 
keyword for SELECT queries :

http://www.postgresql.org/docs/8.4/interactive/sql-select.html

-- 
Maxime



More information about the postgis-users mailing list