Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Database design - relating back to itself
Message
De
20/04/2004 19:03:30
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Database design - relating back to itself
Divers
Thread ID:
00896694
Message ID:
00896694
Vues:
57
I have Accounts - 1 rec per account
Account_Txns - a rec per financial transaction per account

I need to transfer monies between accounts.

Example:
Account 12345 needs to transfer 10.00 to account 98765
Account 23456 needs to transfer 20.00 to account 98765

Not only do I need to create an Account_Txn for account 12345 for -10.00 and for account 23456 for -20.00 but I need to end up with only 1 transaction on account 98765 for the total of +30.00

My problem seems to be that when I think about creating a view to show an account's txns, no matter what kind of design I come up with, I would need to be querying Account_Txns with a join back into itself for the other account's Account_Txns. I know, within reason, I should not be relating an Account_Txn to another Account_Txn but it seems to be the "nature of the beast" because I am transferring between accounts. I am in a vicious circle.

Can someone show me in a generic nature how this might be accomplished?
Thanks,
John
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform