Re: Simple Question!

From: <James>
Date: 1995/04/25
Message-ID: <1995Apr25.113254.8913_at_newton.ccs.tuns.ca>#1/1


In article <3ngli3$7ng_at_crl.crl.com> tmaxwell_at_crl.com (Anthony B. Cillo) writes:
>I am trying to find the oldest 1000 patients in our database. The
>problem is that I cannot get the system to stop after returning 1000
>rows. I have tried using rownum but that only works if you are not
>using order by.
>
>Any ideas?
>
>Thanks
>
>Tony

ROWNUM works with the ORDER BY,
but I don't think it works the way you are expecting.

If you are using ORDER BY to get the oldest 1000 patients, ROWNUM won't work because it does the retrieve 1000 records then the ORDER BY... which won't be what you want.

What you will have to do is trial and error. i.e. WHERE AGE > 65, WHERE AGE > 66, WHERE AGE > 67, etc. until you approximate 1000 records.

There is probably another way... I just can't think of it right now.

James Richard (JRICHARD_at_TUNS.CA)
"No Assembler Required!" Received on Tue Apr 25 1995 - 00:00:00 CEST

Original text of this message