Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL-Select Bug?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00450933
Message ID:
00450955
Vues:
27
>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?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform