1
I want to select the last 10 inserts of a table and among these 10, return the lowest value. It is possible to do this in a single query?
Selecting the last 10 values:
SELECT id_relevo FROM relevo
ORDER BY id_relevo DESC
LIMIT 10
1
I want to select the last 10 inserts of a table and among these 10, return the lowest value. It is possible to do this in a single query?
Selecting the last 10 values:
SELECT id_relevo FROM relevo
ORDER BY id_relevo DESC
LIMIT 10
4
Being direct, it is possible to do this for example using a subquerie.
SELECT min(id_relevo) FROM
(SELECT id_relevo FROM relevo ORDER BY id_relevo DESC LIMIT 10) as minimo
Browser other questions tagged mysql sql database select select-sql
You are not signed in. Login or sign up in order to post.
That’s exactly what it is. Thank you so much!
– Sabrina T.