From: | Richard NAGY <richard(at)presenceweb(dot)com> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | SQL request change when upgrade from 7.0.2 to 7.1.3 |
Date: | 2001-09-14 10:11:41 |
Message-ID: | 3BA1D7DD.569B218C@presenceweb.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
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
From | Date | Subject | |
---|---|---|---|
Next Message | Bhuvan A | 2001-09-14 11:53:01 | |
Previous Message | Advid@newgen | 2001-09-14 09:36:59 | Urgent: How to set autocommit off in postgres......... |