How can I display a distinct Field1 and a Field2 that contains the max value for field2?
For example, from the left table get the right table:
| Field1 | Field2 | | Field1 | Field2 |
-------------------- -------------------
| A | 1 | | A | 3 |
| A | 2 | | B | 2 |
| A | 3 | | C | 4 |
| B | 1 | -------------------
| B | 2 |
| C | 1 |
| C | 2 |
| C | 3 |
| C | 4 |
--------------------
I’m a student yet and still a newbie in MySQL 🙂
1 Answer