Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Union with Order clause not working
Message
From
24/02/2004 15:48:24
 
 
To
24/02/2004 15:42:43
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00880442
Message ID:
00880460
Views:
29
>I thought they were, turns out one table has a bunch of numerics and the other has a bunch of integers. Don't know how that happend... programmer error. The cRow fields are the same though. DO both STRUCTURES have to be EXACTLY the same, not just the field I want to 'Order' on?
>
>Aloha,
>
>James


From the help file (VFP8 SP1):

"When one of the columns has Memo or General type, unions of differing column types should not be allowed.

In versions earlier than Visual FoxPro 8.0, you needed to perform explicit conversion when performing UNION operations between two fields of different types. Visual FoxPro now supports implicit data type conversion for data types that support it. For more details about implicit data type conversion and data type precedence, rules that UNION clauses follow, and other information, see Data Type Conversion and Precedence in the Remarks section.

UNION clauses follow these rules:

  • You cannot use UNION to combine subqueries.
  • Both SELECT commands must have the same number of columns in their query output.
  • When two columns of different data types are involved in a UNION operation, the data type with the lower precedence is converted to the data type with the higher precedence. For more information, see "Data Type Conversion and Precedence" section in the Remarks section.
  • Only the final SELECT statement can have an ORDER BY clause, which must refer to output columns by number. If an ORDER BY clause is included, it affects the entire result."


    Alex Feldstein, MCP, Microsoft MVP
    VFP Tips: English - Spanish
    Website - Blog - Photo Gallery


    "Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
  • Previous
    Next
    Reply
    Map
    View

    Click here to load this message in the networking platform