Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL-Select Bug?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00450933
Message ID:
00450955
Views:
26
>I think you'd have to do something like this:
>
>select customer, sum(invoices) from ;
>(select Customer, count(InvNum) as Invoices;
> from ActiveInvoices;
> group by Customer;
>union select Customer, count(InvNum) as Invoices;
> from HistInvoices;
> group by Customer;
> order by Customer)
>group by customer

And also, you'd have to do UNION ALL, on the chance that a customer might have as many active invoices as history invoices.
My blog
My consulting page
My home page

Member of the Trim Your Auto-Quote Campaign!
What's another word for thesaurus?
Previous
Reply
Map
View

Click here to load this message in the networking platform