Re: Howto sort the result of UNION (without modifying its type)? - Mailing list pgsql-general

From Clemens Eisserer
Subject Re: Howto sort the result of UNION (without modifying its type)?
Date
Msg-id BANLkTinBXpmWwafrHmTnPutkgD9VJZAPYA@mail.gmail.com
Whole thread Raw
In response to Re: Howto sort the result of UNION (without modifying its type)?  (Rob Sargent <robjsargent@gmail.com>)
List pgsql-general
Hi Robert,


> does this work for you?
>        select u.id from (your unions) as u order by u.id

Unfourtunatly not, it converts my union-results from INTEGER to RECORD.
However, it seems to be possible to order the unions directly:
> result1 UNION result2 ORDER BY u.id

Hmm, the query plan looks really insane for this ... wonder how it
will perform when the tables will not be mostly empty ;)

Thanks, Clemens

pgsql-general by date:

Previous
From: quickinfo
Date:
Subject: searchable database
Next
From: Carlos Mennens
Date:
Subject: Re: Rename or Re-Create Constraints?