Re: [GENERAL] Howto sort the result of UNION (without modifying its type)?

2011-04-17 Thread Radosław Smogura
Clemens Eisserer linuxhi...@gmail.com Friday 08 April 2011 23:44:21 Hi, I have a query where I UNION several select statements which return IDs of type INTEGER. This works well, if the IDs don't need to be sorted: SELECT id FROM table WHERE id IN ((select id FROM table WHERE ...) UNION

Re: [GENERAL] Howto sort the result of UNION (without modifying its type)?

2011-04-17 Thread Radosław Smogura
Clemens Eisserer linuxhi...@gmail.com Friday 08 April 2011 23:44:21 Hi, I have a query where I UNION several select statements which return IDs of type INTEGER. This works well, if the IDs don't need to be sorted: SELECT id FROM table WHERE id IN ((select id FROM table WHERE ...) UNION

Re: [GENERAL] Howto sort the result of UNION (without modifying its type)?

2011-04-09 Thread Clemens Eisserer
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

[GENERAL] Howto sort the result of UNION (without modifying its type)?

2011-04-08 Thread Clemens Eisserer
Hi, I have a query where I UNION several select statements which return IDs of type INTEGER. This works well, if the IDs don't need to be sorted: SELECT id FROM table WHERE id IN ((select id FROM table WHERE ...) UNION (SELECT id FROM table_ WHERE )) However I need the result the UNIONs

Re: [GENERAL] Howto sort the result of UNION (without modifying its type)?

2011-04-08 Thread Rob Sargent
On 04/08/2011 03:44 PM, Clemens Eisserer wrote: Hi, I have a query where I UNION several select statements which return IDs of type INTEGER. This works well, if the IDs don't need to be sorted: SELECT id FROM table WHERE id IN ((select id FROM table WHERE ...) UNION (SELECT id FROM table_