Received: from mailout06.sul.t-online.de (mailout06.sul.t-online.com [194.25.134.19]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f8EFV1793030 for ; Fri, 14 Sep 2001 11:31:01 -0400 (EDT) (envelope-from A_Schnabel@t-online.de) Received: from fwd07.sul.t-online.de by mailout06.sul.t-online.de with smtp id 15huva-000303-0C; Fri, 14 Sep 2001 17:30:50 +0200 Received: from taska (520019441306-0001@[217.80.136.117]) by fwd07.sul.t-online.com with smtp id 15huvO-0rrNvkC; Fri, 14 Sep 2001 17:30:38 +0200 Message-ID: <001901c13d32$10498f80$0201a8c0@aschnabel.homeip.net> From: A_Schnabel@t-online.de (Andre Schnabel) To: "Richard NAGY" , References: <3BA1D7DD.569B218C@presenceweb.com> Subject: Re: SQL request change when upgrade from 7.0.2 to 7.1.3 Date: Fri, 14 Sep 2001 17:29:36 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Sender: 520019441306-0001@t-dialin.net X-Archive-Number: 200109/80 X-Sequence-Number: 4733 Can you post the exact errormessage? ----- Original Message ----- From: "Richard NAGY" To: Sent: Friday, September 14, 2001 12:11 PM Subject: [SQL] SQL request change when upgrade from 7.0.2 to 7.1.3 > Hello, > > Recently, I have upgraded my postgresql server from 7.0.2 to 7.1.3. But, > now, one request which was 'good' before, don't want to work any more > now. > > It was : (pretty long) > > SELECT aes.ent_id, e.type, e.nom, aes.sect_id as voulu, > cvd_new(current_date, e.date_entree, 'new') FROM ass_entrep_sectact aes, > > entreprise e WHERE e.id = aes.ent_id and aes.sect_id <> 3 and > aes.sect_id <> 9 > and aes.sect_id <> 1 and aes.sect_id <> 13 and aes.sect_id = 56 > UNION > SELECT distinct on (aes.ent_id) aes.ent_id, e.type, e.nom, aes.sect_id, > cvd_new(current_date, e.date_entree, 'new') FROM ass_entrep_sectact aes, > > entreprise e WHERE e.id = aes.ent_id and aes.sect_id <> 3 and > aes.sect_id <> 9 > and aes.sect_id <> 1 and aes.sect_id <> 13 and aes.sect_id <> 56 and > aes.ent_id > not in (SELECT ent_id FROM ass_entrep_sectact WHERE sect_id = 56 and > sect_id <> 3 > and sect_id <> 9 and sect_id <> 1 and sect_id <> 13) ORDER BY e.type, > e.nom > > Now, if I want that my request works well, I have to remove the order by > statement. But, of course, it is not ordered any more. > > So how can I translate this request to one which can work with an order > by statement ? > > Thanks. > > -- > Richard NAGY > Presenceweb > > >