At 7:22 PM +0000 4/12/07, [EMAIL PROTECTED] wrote:
Consider this query:

       SELECT a, b FROM t1 UNION SELECT b, a FROM t1 ORDER BY a,b;

Is the query above equalent to:

  (1)  SELECT a, b FROM t1 UNION SELECT b, a FROM t1 ORDER BY 1,2;

Or is it the same as:

  (2)  SELECT a, b FROM t1 UNION SELECT b, a FROM t1 ORDER BY 2,1;

I need to know this in order to fix ticket #2296.  It
might not be obvious why this is important to ticket #2296
but it is, so I would appreciate any help.

Alternately, attempting to run that could just be made to fail with an error citing ambiguity. Then users can make it work by making sure the columns they are unioning have the same names (and hence, so does the result of the union), such as by using 'AS' in the select-list. Unless you are explicitly trying to accept ambiguous syntax just because other DBMSs do (to aid portability), that is the simplest option. -- Darren Duncan

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to