I have two related tables (unnecessary columns not listed):
LOCATION
VENUE_ID - NUMBER(38,0)
VISIT
I think you're making this more complex than this needs to be. Below should be all you need:
SELECT l.venue_id , count(distinct v.device_id) FROM location l LEFT JOIN visit v on l.venue_id = v.venue_id GROUP BY l.venue_id