Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Puzzle
Message
De
28/11/2003 11:31:12
 
 
À
28/11/2003 10:12:48
Walter Meester
HoogkarspelPays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00854130
Message ID:
00854231
Vues:
21
Hi Walter,

------------
SELECT genus, species, continent ;
    FROM Species P INNER JOIN Site S ON P.Pkey = S.fkey AND S.continent IN ('Africa','Asia') ;
    WHERE EXISTS (SELECT * FROM Site WHERE fKey = P.Key AND Continent = 'Asia') AND ;
          EXISTS (SELECT * FROM Site WHERE fKey = P.Key AND Continent = 'Africa') ;
    ORDER BY 1,2
------------

If i want a general solution, then:
SELECT genus, species, continent ;
	FROM Species P JOIN Site S ON P.Pkey = S.fkey AND S.continent IN (ContinentList) ;
	WHERE P.Pkey IN (SELECT fkey FROM Site WHERE Continent IN (ContinentList) GROUP BY 1 HAVING COUNT(*)=ContinentListCount) ;
	ORDER BY 1,2
This support 24 elements.

Fabio
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform