Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Query Help
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Divers
Thread ID:
00808214
Message ID:
00808483
Vues:
16
You're welcome. :)

>Thanks Sergey ;)
>
>>Hi Eric
>>
>>Sorry, I misread your original post. Try
>>DECLARE @IdList varchar(8000)
>>SELECT @IdList = ISNULL(@IdList + ', ', '') + StudentId
>>	FROM survey
>>	WHERE StudentId IN ( SELECT StudentId FROM survey
>>		WHERE interest IN (3,45)
>>		GROUP BY StudentId
>>		HAVING COUNT(*) = 2 )
>>GROUP BY StudentId
>>SELECT @IdList
As you can see, ther are two "variables" in this query: the list of interests '(3,45)' and number of values in the list - '2'.
>>
>>
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform