Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is it possible
Message
De
12/02/2013 14:10:41
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Is it possible
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Desktop
Divers
Thread ID:
01565799
Message ID:
01565799
Vues:
94
Before I make myself completely insane trying to do it, say I have a TestFrameWork table that looks like
Cat     TypeB      TypeC     TypeD     TypeE
----------------------------------------------------------------
40          5              3             6            4
41
.
.
.
Where the numbers 5,3, etc are the number of records I need of each Cat and Type and will change periodically but I can't predict what they will be; the 'B','C','D','E' are the difficulty letters (DiffLet). But I need to be able to pull x number of records based on Cat and DiffLet

I know we can say
Select top 5 from (filename) where Cat = '40' and DiffLet = 'B'
Union
(Select top 3 from (filename) where Cat = '40' and DiffLet = 'C'
Union
...
but is it possible to say
Select top TestFrameWork.TypeB from (filename) where Cat = '40' and DiffLet = 'B'
?
"You don't manage people. You manage things - people you lead" Adm. Grace Hopper
Pflugerville, between a Rock and a Weird Place
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform