Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Puzzle
Message
 
 
À
28/11/2003 12:20:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00854130
Message ID:
00854459
Vues:
20
>Sergey,
>
>SQL 1 returns records that should not be in the file. The total returned should be 14 as SQL 2 statement would then duplicate each for Asia and Africa. I suspect the reason is you will find more than one record with the same genus and species if the same continent, but a different site. (Please bear with me, this is my daughter's data.)
>
>Ken
>
>
Ken,

Try this one
* #1
SELECT genus, species, COUNT(DIST continent) AS ContCount ;
	FROM species 
		JOIN site ON species.pkey = site.fkey ;
	WHERE site.continent IN( 'Asia', 'Africa') ;
	GROUP BY 1,2 ;
	HAVING ContCount = 2 ;
	INTO CURSOR curBoth
...
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform