horiyochi
05-26-2004, 11:48 PM
i may sound silly.. but that's that question that asked:
Search for The highest score
Description: There are 7 students in the class. Each of them have their own exam score. You are required to search for the name and score of whoever scores the highest.
Requirement: Provide a SQL statement to get the stated result.
Table Name: MyClass
Johnny 58
Albert 39
Steve 89
Jack 64
Mike 99
Lawrence 40
Andrew 99
Expected Result:
Mike 99
Andrew 99
Unacceptable Answers:
1. SELECT Name, MAX(Score) FROM MyClass
2. SELECT Name, MAX(Score) AS Score FROM MyClass
3. SELECT Name, Score FROM MyClass WHERE Score = 99
.. that's what in the question ... so just want to find out is there any function that can do it ?? other that MAX ?
cheers
Search for The highest score
Description: There are 7 students in the class. Each of them have their own exam score. You are required to search for the name and score of whoever scores the highest.
Requirement: Provide a SQL statement to get the stated result.
Table Name: MyClass
Johnny 58
Albert 39
Steve 89
Jack 64
Mike 99
Lawrence 40
Andrew 99
Expected Result:
Mike 99
Andrew 99
Unacceptable Answers:
1. SELECT Name, MAX(Score) FROM MyClass
2. SELECT Name, MAX(Score) AS Score FROM MyClass
3. SELECT Name, Score FROM MyClass WHERE Score = 99
.. that's what in the question ... so just want to find out is there any function that can do it ?? other that MAX ?
cheers