Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Subqueries as a field expression?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00200658
Message ID:
00200670
Vues:
8
Hi Derek,

>Is there a way to use a subquery as a field expression in VFP5?
>ex:
>select CompanyName, (select sum(cost) from orders where custid = company.custid and cType = 'fruit') as TotalFruit, (select sum(cost) from orders where custid = company.custid and cType = 'beverage') as TotalBeverage from company order by CompanyName

I don't think so. But you could use Orders with two different alias names in the select and then sum those fields. Probably you need some sort of outer join here.

Christof
--
Christof
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform