Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to make it?
Message
De
02/08/2001 08:45:47
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
How to make it?
Divers
Thread ID:
00538762
Message ID:
00538762
Vues:
52
Hi,
I have a parent-child relationship table, which already merge into one signle cursor. I need to deduct it's qty accordingly. How should I SQL it?
Example
My cursor
Parent ID    ChildID       UsedQty
A01          Z01               7      
Z01          X01               5
X01          Y01               8

A01 contains 7 pcs of item Z01. 
Z01 contains 5 pcs of item X01.
X01 contains 8 pcs of item Y01.

I need to calculate the current qty of each item which,

Current Item Qty Before Deducted
--------------------------------
ItemID      Qty
A01         10
Z01          2
X01         12
Y01          6

Expect Result
ItemID       Qty
A01          10
Z01           2 - (10* 7)
X01          12 - ( 2* 5)
Y01           6 - (12* 8)
How to qrite SQL to make it?

Thank you
I am not the most powerful man in this world.
I am not the worst man in this world either.
I just as same as all of you.
I still need to learn from my mistakes...
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform