English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

In Access 2003, I have a table with two columns, in addition to the primary key ID columns. First column contains students' names and second column contains students marks. I am trying to create a query which would display name and marks highest scoring student. When I use MAX or MIN (for lowest scoring student) query displays only marks, and does not display the students name.

2007-08-13 08:49:44 · 4 answers · asked by szhob 3 in Computers & Internet Programming & Design

select max(marks) displays only marks. I want to display corresponding name too.

2007-08-13 09:47:32 · update #1

4 answers

If I read your question correctly you want the name and the mark for only the top (or bottom) scoring student. If that's the case you can use a subquery to get the result(s) you want:

SELECT StudentName, Mark FROM Table WHERE Mark =(SELECT MAX(mark) FROM Table)

2007-08-13 10:31:26 · answer #1 · answered by floydno5 2 · 3 0

You need to include the Name column, in your query.

2007-08-13 08:53:03 · answer #2 · answered by Cesar V 2 · 1 1

Isn't there mix() and max() in SQL? Put yourself in SQL mode within Access this is simple query.

select max(marks) from Table

2007-08-13 08:57:33 · answer #3 · answered by Andy T 7 · 1 1

you want to go to the microsoft office help page & search there

cheers!

2007-08-13 08:52:22 · answer #4 · answered by michael 6 · 1 1

fedest.com, questions and answers