Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Statement How To
Message
 
To
09/06/2009 14:21:06
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Application:
Desktop
Miscellaneous
Thread ID:
01404764
Message ID:
01404771
Views:
31
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform