0
Imagine the following lines in my Mysql database:
I want a query that displays the name and age of the person who has the highest age in the table, for that I did this query:
SELECT nome, MAX(idade)
from pessoas;
But it does not return the name correctly.
I need a solution that conditions the name the age returned by the command MAX
, I didn’t want an understatement that compares age to age MAX(idade)
another query. There is this I need?
What name do you want me to return? What’s going wrong? And why don’t you want an undercurrent?
– Maniero
Cannot group by name?
– Felipe
Did any of the answers solve your question? Do you think you can accept one of them? Check out the [tour] how to do this, if you haven’t already. You would help the community by identifying what was the best solution for you. You can accept only one of them. But you can vote on any question or answer you find useful on the entire site (when you have enough score).
– Maniero