Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query Help
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Miscellaneous
Thread ID:
00808214
Message ID:
00808483
Views:
15
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--
Previous
Reply
Map
View

Click here to load this message in the networking platform