I'm currently using min()
to find the lowest value within MYSQL database.
How could i find the second lowest value?
'select Date, Horse, ParentID, min(odds2)
from horsesrp
where odds2 < 3.1 and odds2 > 1.9
and Date = "'.$id.'"
AND Track IN ("Kempton (AW)","Wolverhampton (AW)")
group by ParentID order by ParentID'
please note i still need to order by ParentID as i want to get the second lowest odds2 per parentid
so my database look like:
Racetime Odds
13:05 2
13:05 2.4
13:05 3
13:05 5
13:30 3
13:30 5
13:30 9
13:30 13.5
14:00 1.14
14:00 1.19
14:00 2
14:00 4
i want to find the second lowest value for each time but it must be between 1 and 2.9
Racetime Odds
13:05 2.4
14:00 1.19
so the output for the above would be
Thanks
Emma
Copyright License:
Author:「emma perkins」,Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.
Link to:https://stackoverflow.com/questions/27941820/mysql-select-second-lowest-value