Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Joins
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Re: Joins
Divers
Thread ID:
00585006
Message ID:
00585011
Vues:
45
This message has been marked as the solution to the initial question of the thread.
Put join conditions after a join it's related to
select masthead.*, mastdetl.*, staff.* ;
	FROM  masthead 
          INNER JOIN mastdetl ON  Masthead.id = Mastdetl.id ;
	  INNER JOIN staff ON  Masthead.staff = Staff.s_code ;
	WHERE !masthead.exported ;
	INTO cursor headstaffdetl
Are the 7 records returned in the first select include any masthead records from the second select?

>Hi
>
>Could someone please explain to me why
>select masthead.*, mastdetl.* ;
>	FROM  masthead INNER JOIN mastdetl;
>	ON  Masthead.id = Mastdetl.id ;
>	WHERE !masthead.exported ;
>	INTO cursor headdetl
>
>returns 7 records (all detail links found)
>
>and
>
>select masthead.*, staff.* ;
>	FROM  masthead INNER JOIN staff ;
>	ON  Masthead.staff = Staff.s_code ;
>	WHERE !masthead.exported ;
>	INTO cursor headstaff
>
>returns 3 records    (all headers have a staff record)
>
>yet
>
>select masthead.*, mastdetl.*, staff.* ;
>	FROM  masthead INNER JOIN mastdetl;
>		INNER JOIN staff ;
>	ON  Masthead.staff = Staff.s_code ;
>	ON  Masthead.id = Mastdetl.id ;
>	WHERE !masthead.exported ;
>	INTO cursor headstaffdetl
>
>returns nothing.
>
>even stranger is the fact that
>
>select headdetl.*, staff.* ;
>	FROM  headdetl INNER JOIN staff ;
>	ON  headdetl.staff = Staff.s_code ;
>	WHERE !headdetl.exported ;
>	INTO cursor headdetlstaff
>
>returns my 7 records.
>What gives???
>
>An extremely confused
>Geoff Scott
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform