Okay, that subject is clear as mud, but it's the best I could do.
I have a table with two fields: "Seq" which is an int, and "Typ" which is an ENUM('Q','A'). (There's more than those two, but...) I know how to write a query to find out the maximum value for "Seq" but I don't really care about that value. What I want to know is the value of "Typ" in the row that contains that maximum value. Is there a single query to do that?
Value of another field in the row that contains MAX(field)
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Code: Select all
SELECT `Typ` FROM `table` ORDER BY `Seq` DESC LIMIT 1