Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Syntax of multiple UNION clause
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00650671
Message ID:
00650677
Views:
17
>Hi folks,
>
>Vfp 7 help file mentions about parenthesis to combine multiple unions in select sql command.
>
>I can't get it to work. Please help...
>
>TIA
>
>-Ahmed

Can you post the SQL you are trying to use? General tips:

The fields you select must be of the same data types in each SELECT in the union. You can only have 1 order by and group by clause and they must be after the last SELECT. You can use a GROUP BY in a sub-query. The 3rd line below is a sub-query:
select number_field, date_field from ...
  where somefield in 
     (select * from ... where ... group by...)
union
select number_field2, date_field2 from ...
group by ...
order by...
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform