Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT a.*
- FROM turtle_derby AS a
- INNER JOIN (SELECT turtle_id, DATE(`date`) AS day_date, MAX(`date`) AS maxdate
- FROM turtle_derby
- GROUP BY turtle_id, day_date) AS groupedtt
- ON a.turtle_id = groupedtt.turtle_id
- AND a.turtle_id = '175846'
- AND a.`date` = groupedtt.maxdate
- AND a.`date` > '2018-07-26'
- ORDER BY `a`.`date`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement