Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Summing by location
Message
 
À
27/07/1999 10:51:29
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:
00246638
Vues:
28
Actually, I understand what you're saying, but if I'm getting SQL correct on a join the circles aren't always parent on left, child on right, instead, a left join says that parent is on left, a right join says that the parent is on right...but I tried both right and left joins and I still don't get what I'm looking for:(


>Set theory (I'm not strong on it) but visualize your data as sets of dots with circles around them. The two circles overlap. On the left side is your master table, on the right side is your child table. A right join says, "Give me every child, matching parent where you can, and provide blank partents where you can't match" a left join says, "Give me every master and matching every child where you can, and giving me blank children where you can't match"
>
>Maybe I didn't read the problem correctly, but I think you need a left join.
>

>>>>Here again is the statement I have thus far:
>>>>
SELECT INMAST.FPARTNO, INONHD.FONHND ;
>>>>	FROM INONHD RIGHT JOIN INMAST;
>>>>	ON INONHD.FPARTNO=INMAST.FPARTNO;
>>>>	WHERE &LCWHERE;
>>>>	INTO CURSOR TMP1
>>>>LCWHERE is concatenated according to other conditions within the form...is there a way to put like an IIF() like this?
>>>>
SELECT INMAST.FPARTNO,IIF(EMPTY(INONHD.FONHND),'0' AS FONHND,INONHD.FONHND)...
>>>>I've tried the above and it keeps giving me an error when the SQL is executed that it needs a )....got any ideas?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform