Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT horseNumber, raceIndex, racecourse, winodds, place,
- CASE
- WHEN winodds = (select min(winodds) from race r2 where r1.raceIndex=r2.raceIndex and r1.racecourse = r2.racecourse and (r1.place='01' or r1.place='1') group by r2.raceIndex, r2.racecourse)
- THEN 1
- ELSE 0 END AS fav_odd_win
- FROM race r1 order by favor_lastrace desc;
Add Comment
Please, Sign In to add comment