Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP6 SQL question regarding joins
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00412850
Message ID:
00412859
Vues:
10
>Hi All,
>
>I'm trying to join two tables.
>
>The first table is my transaction table and one record is created for each service performed.
>
>The second table is my cash receipts table and each time a payment is made on a transaction a record is created in the cash receipts table.
>
>There may be no corresponding records in the cash receipts table, if no payments have been made, there may be just one record in the cash receipts table if one payment in full was made, or therE may be many corresponding records if more than one partial payment was made on a transaction.
>
>I want my result cursor to list each and every transaction whether any payment has been made or not and, to include all payment records for each transaction record.
>
>I've tried doing this in two stages but just can't seem to get the results I know I should be getting.
>
>Here's the first sql on the transaction table:
>
>select hftrns where hftrns.acct_no = ;
>"26733" order by hftrns.stateno, hftrns.seqno into cursor transtable
>

Since you have the FROM in the other examples, I won't mention it here <g>

LEFT OUTER JOIN is your answer.
select transtable.*, hfcashr.* ;
  from transtable ;
  left outer join hfcashr ;
  on transtable.acct_no = HFCASHR.ACCT_NO
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform