Subject RE: [firebird-support] Re: Calling all SQL gurus
Author Clay Shannon
JJ Ochoa suggested:

<< What about

select p.firstname, p.lastname, a.admit_date, a.ADMISSION_ID,
a.ADMIT_ORDINAL, d.departure_date

from patient_admissions a join departures d
on d.admission_id = a.ADMISSION_ID

join patients p
on p.PATIENT_ID = a.admission_id

where d.DEPARTURE_DATE is null>>

Thanks, Juan Jose,

Unfortunately that doesn't work, either, because there's no record at all in
the Departures table until they depart. Your select statement is
syntactically fine, but returns no records.

Another way of looking at what I need is something like this:

Select <whatever>
From <blab la>
Where count(<Patient_admissions column>) > count(<Departure column>)

Clay Shannon,
Dimension 4 Software