Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Duplicate results from a unioned Select
Message
 
 
To
01/09/2000 13:48:14
John Tomblin
Service Station Systems, Inc.
San Jose, California, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00411880
Message ID:
00411962
Views:
16
In a UNION, you can only have 1 GROUP BY and 1 ORDER BY and each has to e after the last UNION SQL. You also have to reference the GROUP BY and ORDER BY items by number. How about something like:
select Field1, sum(Field2) from Table1;
     where Field3 <> "XXX";
union select Field1, sum(Field2) from Table2;
     where Field3 <> "XXX";
     and Field1 not in (select field1 from table1);
     group by 1
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform