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
SELECT * FROM table_name ORDER BY id ASC LIMIT 1, 1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With