Advertisement
Guest User

Untitled

a guest
Apr 7th, 2020
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.37 KB | None | 0 0
  1. select count(*) from (select cl1.* from credential_list cl1 left join credential_list cl2
  2.     on (cl1.doc_type = cl2.doc_type and cl1.id = cl2.id and cl1.updated_date < cl2.updated_date)
  3. where cl2.updated_date is null) as cl_filtered_latest_udpated_date_per_id_doc_type
  4. where doc_type = 'PHA' and validity_date > CURDATE() and validity_date <= DATE_ADD(CURDATE(), INTERVAL 1 MONTH);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement