-Re: UNION -- Ordered
Thejas M Nair 2010-07-29, 01:05
As you observed, union does not guarantee the ordering . You will need to project an additional column indicating the order you want, so that you can do an order-by on it.
On 7/28/10 2:45 PM, "elein" <[EMAIL PROTECTED]> wrote:
A = FOREACH ...
B = FOREACH ...
C = FOREACH ...
X = UNION A, B, C,...
Each of the A, B, C data is a single tuple. I want X ordered
by the order specified in the UNION. The data in A, B, C, ... is not
necessarily in explicit sort order so ORDER X by field does not work. I've tried breaking
the union into only unioning two pieces then that union plus another piece, etc.
That does not work either.
Anyone have any ideas how to do this