FIX: SELECT ... UNION Produces Unexpected Output

Last reviewed: October 14, 1997
Article ID: Q109581
2.5x 2.60 | 2.5x 2.60 | 2.50b
WINDOWS   | MS-DOS    | MACINTOSH
kbprg kbbuglist kbfixlist

The information in this article applies to:

  • Microsoft FoxPro for Windows, versions 2.5x, 2.6
  • Microsoft FoxPro for MS-DOS, versions 2.0, 2.5x, 2.6
  • Microsoft FoxPro for Macintosh, version 2.5b

SYMPTOMS

The UNION clause of the SELECT statement can cause unexpected output under certain circumstances.

STATUS

Microsoft has confirmed this to be a problem in the products listed at the beginning of this article. This problem was corrected in FoxPro version 2.6a for MS-DOS and FoxPro version 2.6a for Windows.

MORE INFORMATION

Steps to Reproduce Problem

Executing the following code will demonstrate this problem:

  CREATE TABLE test1 (one c(1), two c(1), three c(1))
  INSERT INTO test1 VALUES ('a','b','c')

  CREATE TABLE test2 (one c(1), two c(1), three c(1))
  INSERT INTO test2 VALUES ('a','b','c')

  * Notice the output produced by this SELECT statement, which includes
  * the clause "UNION ALL".

  SELECT one,two,three FROM test1 UNION ALL ;
  SELECT one,one,three FROM test2 TO SCREEN

     ONE TWO THREE
     a   b   c
     a   a   c

  * Notice the output produced by this SELECT statement, which includes
  * the clause "UNION". It is different from the output produced by the
  * previous SELECT statement, which includes the clause "UNION ALL".

  SELECT one,two,three FROM test1 UNION ;
  SELECT one,one,three FROM test2 TO SCREEN

     TWO_A TWO_B THREE
     a     a     c
     b     b     c


Additional reference words: FoxMac FoxDos FoxWin 2.50 2.50a 2.50b sql
server
windows nt
union
buglist2.50 buglist2.50a buglist2.50b buglist2.60 fixlist2.60a
KBCategory: kbprg kbfixlist kbbuglist
KBSubcategory: FxprgSql
Keywords : FxprgSql kbbuglist kbfixlist kbprg
Version : 2.5x 2.60 | 2.5x 2.60 | 2.50b
Platform : MACINTOSH MS-DOS WINDOWS
Solution Type : kbfix


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 14, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.