I have a list of hospitals (FacilityID_UUID) that have to submit data every day (date = create_date).
On a given day, I'd like to establish which did NOT report on the previous day.
Started with this:
SELECT `FacilityID_UUID`
FROM `TEST`
where `FacilityID_UUID` not in (
SELECT distinct `FacilityID_UUID`
FROM `TEST`
where `Create_Date` = '2014-09-16'
)
(will replace dates with sysdate, or interval 1 day)
However, I have two problems with this:
1- it is soooo slow! Been running like 30 mins now and I'm not expecting more than 20 results). How can I make it faster?
2- it only provides me with the names of hospitals who submitted at least once in a the past, but not yesterday. If more hospitals begin submission on Wednesday, I'd like Thursday's query to pick up that. Basically, I'd like to say "give me hospitals on list X which did not submit yesterday" and write up the list X myself.
Any ideas