SHARE
TWEET

Untitled

a guest Feb 22nd, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. DECLARE latest_exam date;
  2.  
  3.   SELECT DATE(MAX(ex_date))
  4.     INTO latest_exam
  5.     FROM vets
  6.    WHERE an_id = p_animal_id
  7. GROUP BY an_id;
  8.  
  9. SELECT latest_exam, and a bunch of other stuff. ;
  10.    
  11. SELECT x.maxDate,
  12.        b.*
  13. FROM tableName b,
  14.     (
  15.         SELECT DATE (max(ex_date)) maxDate
  16.         FROM vets
  17.         WHERE an_id = p_animal_id
  18.         GROUP BY an_id
  19.     ) x
  20.    
  21. select latest_exam = date(max(ex_date))..
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top