Re: (un)grouping question

From: Tonkuma <tonkuma(at)fiberbit(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: (un)grouping question
Date: 2008-01-21 18:38:25
Message-ID: c5599b62-7a8f-4882-8fb5-99dae19ad7c6@h11g2000prf.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Don't this satisfy your requirement?
(This isn't tested. There may be some syntax error.)
DELETE FROM your_table T
WHERE uid >
(SELECT MIN(uid)
FROM your_table M
WHERE M.somevalue = T.somevalue
)
;

The result I expected is:
SELECT * FROM your_table;

uid|somevalue
--------------------
1|11
3|31
6|33
2|44
5|71

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2008-01-21 18:47:04 Re: [GENERAL] setof record "out" syntax and returning records
Previous Message Reece Hart 2008-01-21 18:32:20 Re: Deadlock in Postgres 8.2