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:
00808481
Vues:
13
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 valuses in the list - '2'.
>
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform