How do I see if a horse is entered more than once?

+1 vote

Is there a Smartform query that allows me to see any horse that has more than one entry on any given day's racing?

asked Apr 14, 2011 in Smartform by betwise1 Novice (450 points)

1 Answer

+1 vote
 
Best answer
When daily_runners sometimes contain horses that have been left in at the declaration stage for more than one race you can find out which horses are double entered and display details of the races as follows:

> select name,count(*), scheduled_time, course as declarations from daily_runners join daily_races using (race_id) where meeting_date=CURDATE() group by name having declarations > 1;

You should change CURDATE() as needed according to the meeting_date that you want to look up.
answered Apr 17, 2011 by colin Frankel (19,320 points)
...