pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mike E <mee@quidquam.com>
To: pgsql-php@postgresql.org
Subject: Time Difference
Date: Fri, 27 Oct 2000 00:17:39 -0700
Message-ID: <20001027001739.E28299@quidquam.com> (raw)

I have the following setup:

appt=# select * from availability \g
 emp_id |    date    | start_time | end_time 
--------+------------+------------+----------
      1 | 2000-10-30 | 08:00:00   | 14:30:00

appt=# select * from appointments \g
 start_time | end_time | emp_id | cus_id | services |    date    
------------+----------+--------+--------+----------+------------
 09:00:00   | 11:30:00 |      1 |      2 | {1,2,3}  | 2000-10-30

Now, what I would like to get is the following:

 start_time | end_time 
------------+----------
 08:00:00   | 09:00:00
 11:30:00   | 14:30:00

I'm trying to generate a result set of all the free time slots in
availability by taking the difference of the two. I've so far been
unable to generate anything that works. Is this possible?

Mike

-- 
Mike Erickson <mee@quidquam> http://www.quidquam.com/
"Hatred is the coward's revenge for being intimidated" - George Bernard Shaw



Message-ID: <20001027001739.E28299@quidquam.com>
Permalink:  ../20001027001739.E28299@quidquam.com/
Also on:    postgresql.org/message-id/20001027001739.E28299@quidquam.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: mee@quidquam.com
  Subject: Re: Time Difference
  In-Reply-To: <20001027001739.E28299@quidquam.com>
  References: <20001027001739.E28299@quidquam.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox