Re: [SQL] No sort with except

2012-03-01 Thread Jasen Betts
On 2012-03-01, reto.buc...@wsl.ch wrote: > Dies ist eine mehrteilige Nachricht im MIME-Format. > --=_alternative 002D2CF5C12579B4_= > Content-Type: text/plain; charset="US-ASCII" > > Dear all, > > When I run the following SQL with PostgreSQL 9.1: > > -- > SELECT DISTINCT ON (pernr) pernr, vorna, n

Re: [SQL] No sort with except

2012-03-01 Thread Philip Couling
o.buc...@wsl.ch wrote: > > pgsql-sql-ow...@postgresql.org schrieb am 01.03.2012 09:16:53: > >> From: Frank Lanitz >> To: pgsql-sql@postgresql.org, >> Date: 01.03.2012 09:16 >> Subject: Re: [SQL] No sort with except >> Sent by: pgsql-sql-ow...@postgresql.org

Re: [SQL] No sort with except

2012-03-01 Thread reto . buchli
pgsql-sql-ow...@postgresql.org schrieb am 01.03.2012 09:16:53: > From: Frank Lanitz > To: pgsql-sql@postgresql.org, > Date: 01.03.2012 09:16 > Subject: Re: [SQL] No sort with except > Sent by: pgsql-sql-ow...@postgresql.org > > Am 01.03.2012 09:13, schrieb reto.buc...

Re: [SQL] No sort with except

2012-03-01 Thread Frank Lanitz
Am 01.03.2012 09:13, schrieb reto.buc...@wsl.ch: > Dear all, > > When I run the following SQL with PostgreSQL 9.1: > > -- > SELECT DISTINCT ON (pernr) pernr, vorna, nachn, eindt, ausdt, updat, status > FROM person > > WHERE eindt <= TO_CHAR(CURRENT_DATE,'MMDD') > AND ausdt

[SQL] No sort with except

2012-03-01 Thread reto . buchli
Dear all, When I run the following SQL with PostgreSQL 9.1: -- SELECT DISTINCT ON (pernr) pernr, vorna, nachn, eindt, ausdt, updat, status FROM person WHERE eindt <= TO_CHAR(CURRENT_DATE,'MMDD') AND ausdt >= TO_CHAR(CURRENT_DATE,'MMDD') ORDER BY pernr, eindt DESC; -- it wo