Re: sql that is making my brain hurt

From: David Lord <dlordster_at_gmail.com>
Date: Wed, 20 Feb 2008 16:13:37 +0000
Message-ID: <649030d80802200813r1fd90361n9a9eabb5aeece4be@mail.gmail.com>


SQL> select resource_id, start_res from dcl_1   2 union
  3 select resource_id, end_res from dcl_1 order by 2;

RESOURCE_ID START_RES

----------- -------------------
          1 2008-02-20 16:11:16
          1 2008-02-20 16:11:23
          1 2008-02-20 17:11:16
          1 2008-02-20 18:11:23

Regards
David Lord

On 20/02/2008, Stephens, Chris <chris_stephens_at_admworld.com> wrote:
>
>
>
>
> I am writing a scheduling application in apex. Resources are reserved by
> hour. I need a calendar to show when resources are reserved.
>
>
>
> In the 'day view' of that calendar I need the schedule split out by hour.
>
>
>
> Resource_id number
>
> Start_res date
>
> End_res date
>
>
>
> If I have a row like: 1, Jan 01 2008 8am, Jan 01 2008 10am, I need the query
> to return:
>
>
>
> 1, Jan 1 2008 8am
>
> 1,Jan 1 2008 9am
>
>
>
> So far I've been unable to come up with the sql. Anybody got a quick
> answer?
>
>
>
>
>
> It is amazing how hard sql seems when you haven't had to write anything of
> any substance in a long time.
>
>
>
> Thanks!
>
>
>
>
>
>
> CONFIDENTIALITY NOTICE:
> This message is intended for the use of the individual or entity to which
> it is addressed and may contain information that is privileged,
> confidential and exempt from disclosure under applicable law. If the reader
> of this message is not the intended recipient or the employee or agent
> responsible for delivering this message to the intended recipient, you are
> hereby notified that any dissemination, distribution or copying of this
> communication is strictly prohibited. If you have received this
> communication in error, please notify us immediately by email reply.

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Feb 20 2008 - 10:13:37 CST

Original text of this message