Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Random selection
Message
 
 
To
27/06/2011 11:35:39
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01516199
Message ID:
01516276
Views:
31
You can use a temp table or table variable

>
>Now if I can just use some cursors :-)
>
>>Try
>>DECLARE @RecCount int
>>SET  @RecCount = 50000 - < # of records in previous 2 groups >
>>SELECT TOP (@RecCount) 
>>  FROM mytable 
>>  WHERE < record does not belong to 2 previous groups >
>>  ORDER BY NewID()
>>
>>
>>>
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform