Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Summing by location
Message
De
26/07/1999 12:59:19
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00246115
Message ID:
00246161
Vues:
24
Try:
SELECT Inv.Location, Count(OnHand.PK);
   FROM Inv;
   LEFT OUTER JOIN OnHand ON Inv.PK = OnHand.FK;
   GROUP BY Inv.Location
HTH

>I'm not certain as to how to obtain the results I want from a SELECT-SQL statement...
>
>For inventoy there are 2 tables, a master holding all inventory items, and an on-hand, holding only parts that are available in the stockroom or factory. When I select I do an inner join on the part number where the location matches one specified...like 01 for stock, 02 for factory. The onhand table holds only what's in stock, so if there's some in 02, but not 01, then 02 is the only record in the onhand table...that works fine, but for my SQL results I want to show 0 on hand in location 01 when they do a WHERE location=01. What's the best way to do this?
>
>Also, when finding onhand for all locations, I want to show the sum of all locations for that part. Again, what's the best way to proceed?
>
>Should I be using several SELECT statements? Or should I try using a filter? Thanks for any help you might be able to provide, since I'm really quite a greenhorn with SQL;)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform