RE: Hotsos Symposium, Day 1

  • From: "Anthony Molinaro" <amolinaro@xxxxxxxx>
  • To: <tomday2@xxxxxxxxx>, <oracle-l@xxxxxxxxxxxxx>
  • Date: Tue, 8 Mar 2005 13:43:37 -0500

Tom,
  Agreed. Strictly speaking it isn't necessary, this works as well:

with x as (
SELECT TRUNC(SYSDATE,'YEAR') + LEVEL - 1
FROM DUAL
CONNECT BY LEVEL < TRUNC(SYSDATE+366,'YEAR') - TRUNC(SYSDATE,'YEAR') + 1
)
select * from x;


not sure why it's there...

 - a

-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of Thomas Day
Sent: Tuesday, March 08, 2005 12:31 PM
To: oracle-l@xxxxxxxxxxxxx
Subject: Re: Hotsos Symposium, Day 1

I guess that what I don't understand is why the 1=3D1 is in there at
all.  The following produces 365 rows of output for me.  Does the 1=3D1
perform a useful function?  I understand that it evaluates as true.  I
don't understand why you feel it's needed.

SELECT TRUNC(SYSDATE,'YEAR') + LEVEL - 1
  FROM (SELECT 'X' FROM DUAL WHERE rownum =3D 1)
 CONNECT BY
--1 =3D 1    AND
LEVEL < TRUNC(SYSDATE+366,'YEAR') - TRUNC(SYSDATE,'YEAR') + 1
/
--
//www.freelists.org/webpage/oracle-l
--
//www.freelists.org/webpage/oracle-l

Other related posts: