Comparing fields and choosing record to display

C

Cita

Hello:

I am trying to figure out how to compare the same field in different records
to return the record that contains the higher value in a different field (in
a second query). In other words,

Field 1 Field 2
A34RT 400
A67YR 200
A34RT 250
A34RT 350

So, from this example, my 2nd query would return

Field 1 Field 2
A34RT 400
A67YR 200

Any help would be appreciated.

Thanks!
 
B

Beetle

As an example;

SELECT Field1, Max(Field2) As MaxOfField2 FROM YourTable
GROUP BY YourTable.Field1
ORDER BY Max(Field2) DESC;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top