1
In a Mysql table
id valor
1 5
2 15
3 7
I want to take the value of the "id" that has the highest value in the value field. I want to return in this case the value 2.
1
In a Mysql table
id valor
1 5
2 15
3 7
I want to take the value of the "id" that has the highest value in the value field. I want to return in this case the value 2.
4
Sort the result by DESC and limit to 1:
SELECT
id
FROM tabela
ORDER BY valor DESC
LIMIT 1;
Browser other questions tagged php mysql laravel-5
You are not signed in. Login or sign up in order to post.
Correct. was trying to select id from Where table MAX(value);
– Dan Even