My solution that works is:
select date_range as rdate,
case
when rsgsid is not null then 2
when aid is not null then 1
else 0
end as status
from date_range('2007-04-01','2007-04-30')
left join availability a on a.asid = 1 and (date_range,date_range) overlaps
(a.asdate,a.afdate)
left join roster_staff r on r.rsdate = date_range;
Can anyone see any problems or improvements to this?
--
Gary Stainburn
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000