Re: How to delete the not DISTINCT ON entries
От | Achilleus Mantzios |
---|---|
Тема | Re: How to delete the not DISTINCT ON entries |
Дата | |
Msg-id | Pine.LNX.4.44.0406161511460.2590-100000@matrix.gatewaynet.com обсуждение исходный текст |
Ответ на | How to delete the not DISTINCT ON entries (Christoph Haller <ch@rodos.fzk.de>) |
Ответы |
Re: How to delete the not DISTINCT ON entries
|
Список | pgsql-sql |
O kyrios Christoph Haller egrapse stis Jun 16, 2004 : > Referring to the DISTINCT ON example > > SELECT DISTINCT ON (location) location, time, report > FROM weatherReports > ORDER BY location, time DESC; maybe smth like delete from weatherReports where (location,time,report) not in (SELECT DISTINCT ON (location) location, time, report FROM weatherReports ORDER BY location, time DESC) Note: Order by is very important, since it affects which rows are deleted. > > How would I delete those entries skipped by the DISTINCT ON expression? > > TIA > > Regards, Christoph > > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org > -- -Achilleus
В списке pgsql-sql по дате отправления: