This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi, I am using JDBC to connect to an Access table. I have a simple table called: Student (StudID, FName, LName, Marks) I would like to find out the student with the highest marks: SELECT StudID, max(Marks) AS maxMarks FROM Student GROUP by StudId I get multiple rows returned whereas I need only the highest one. I am facing a similar problem in other tables too. How can I get all the fields of only the highest row ? Thanks in advance. Anoop
I believe a correlate subquery is what you're after: "SELECT StudID, FName, LName FROM student where Marks = (SELECT MAX(Marks) FROM students)" This will return all student information that have a mark equal to the best mark. Jamie