Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Statement How To
Message
 
À
09/06/2009 14:21:06
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2005
Application:
Desktop
Divers
Thread ID:
01404764
Message ID:
01404771
Vues:
30
>We are working on a teacher certification project and need to be able to track each students level through the program. We have written SQL statements that can determine what students have achieved each level. Is there a way I can check each subquery in sequence to determine the current level for each student. For example if the student is found in the level five query I know they are level five and I can end my search. Otherwise I need to check for their existence in each of the other level queries (Level 3, Level 2, and Level 2). I would like to have one SQL statement in the end that simply returns the students id and current level. Is this possible?
>
>Thanks In Advance
>
>Jeff Hibbs
>The Blencowe Group

It is (hmmm, at least I think so), but as Sergey said we need more info.
In general
SELECT StudentId, MAX(Level) AS Level
       FROM YourTable
GROUP BY StudentId
should give you the highest level student have.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform