Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DECLARE latest_exam date;
- SELECT DATE(MAX(ex_date))
- INTO latest_exam
- FROM vets
- WHERE an_id = p_animal_id
- GROUP BY an_id;
- SELECT latest_exam, and a bunch of other stuff. ;
- SELECT x.maxDate,
- b.*
- FROM tableName b,
- (
- SELECT DATE (max(ex_date)) maxDate
- FROM vets
- WHERE an_id = p_animal_id
- GROUP BY an_id
- ) x
- select latest_exam = date(max(ex_date))..
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement