Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Random selection
Message
 
 
À
27/06/2011 11:35:39
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01516199
Message ID:
01516276
Vues:
32
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--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform