Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: table containing the days for a week

Re: table containing the days for a week

From: <pobox002_at_bebub.com>
Date: 26 Apr 2005 10:06:21 -0700
Message-ID: <1114535181.352349.175470@o13g2000cwo.googlegroups.com>


Kevin Crosbie wrote:
> <pobox002_at_bebub.com> wrote in message
> news:1114391236.692176.250100_at_f14g2000cwb.googlegroups.com...
> > If you have 9i or up you could use a view like this
>
> Or you could use this subquery:
> select to_date('2005-04-16', 'YYYY-MM-DD') + (rownum - 1)
>
> from user_objects
>
> where rownum <= 7;
>
> or if you always want the current week:
> select trunc(sysdate, 'DD') + 1 - to_char(sysdate, 'D') + rownum as
> day_of_week
>
> from user_objects
>
> where rownum <= 7;

May work.

SQL> select count(*) from user_objects;

  COUNT(*)


         1

May not.

It would certainly be much more inefficient.

-- 
MJB
Received on Tue Apr 26 2005 - 12:06:21 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US