>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
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--