SQL Syntax Error, details: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Herbe' and s.racedate >= 1514786400 and s.racedate <= 1525150800 order by (SEL' at line 1
SELECT s.j_id, (SELECT race.Race_Name FROM race Inner Join raceinput ON race.Race_AutoId = raceinput.Race_AutoID where raceinput.id =s.linesid) as RaceName, (SELECT race.Race_Date FROM race Inner Join raceinput ON race.Race_AutoId = raceinput.Race_AutoID where raceinput.id =s.linesid) as RaceDate, (select jockey from jockeys where j_id=s.j_id) as jockeyname, (select horse from horses where h_id=s.h_id) as horsename, (SELECT race.Race_No FROM race Inner Join raceinput ON race.Race_AutoId = raceinput.Race_AutoID where raceinput.id =s.linesid) as RaceNo, s.first_status as firstplace, s.second_status as secondplace, s.third_status as thirdplace, s.fourth_status as fourthplace, s.fifth_status as fifthplace, s.sixth_status as sixthplace, s.result as raceResult, (s.up + s.sixth_status) as up FROM statistics s where s.status=1 and s.result_race<>'NR' and s.result_race<>'WD' and s.result<>'' and (select jockey from jockeys where j_id=s.j_id) = 'B Fayd'Herbe' and s.racedate >= 1514786400 and s.racedate <= 1525150800 order by (SELECT race.Race_Date FROM race Inner Join raceinput ON race.Race_AutoId = raceinput.Race_AutoID where raceinput.id =s.linesid) Desc