Solved - best way: diary functions.

From: Gary Stainburn <gary(dot)stainburn(at)ringways(dot)co(dot)uk>
To: pgsql-sql(at)postgresql(dot)org
Subject: Solved - best way: diary functions.
Date: 2007-04-04 13:27:08
Message-ID: 200704041427.09056.gary.stainburn@ringways.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Peter Eisentraut 2007-04-04 13:54:56 Re: CPU statistics
Previous Message Igor Neyman 2007-04-04 13:17:50 Re: exception handling in postgres plpgsql