Re: same reseult set with less column

From: Ed Prochak <edprochak_at_gmail.com>
Date: Mon, 29 Sep 2008 13:36:02 -0700 (PDT)
Message-ID: <053bacf1-7397-4f00-84e6-5e76cf0574de@8g2000hse.googlegroups.com>


On Sep 29, 9:20 am, "dt1649..._at_yahoo.com" <dt1649..._at_yahoo.com> wrote:
> On Sep 28, 9:46 pm, Ed Prochak <edproc..._at_gmail.com> wrote:
>
> > Since you are using JAVA, why not open the cursor, fetch the N rows
> > you need and close the cursor?
>
> > No offense intended, DT, but I've never been a fan of ROWNUM. It leads
> > to wrong thinking about database results. The row count treats results
> > like records instead of rows. And funny how it always seems to be web
> > apps that use this most often.
>
> > Can you describe what constitutes the TOP N rows? What ordering do you
> > use? Often if you can describe the rule you can code it into the
> > query.
>
> Ed, thanks for your advice. Because the data may contains hundreds of
> thousands of rows, it takes a lot of memory to read all of them. So I
> use "lazy read" to read only one  page at a time and when users want
> to see a page that is not already in memory, then I will fetch that
> page only. So I use the top-N to read that page.
>
> Here is what I use :http://www.oracle.com/technology/oramag/oracle/07-jan/o17asktom.html
>
> Thanks,
> DT

Tom's article mentions three ways to do get top-N rows. So which do you use?

Are you sure you are not missing any?
  Ed. Received on Mon Sep 29 2008 - 15:36:02 CDT

Original text of this message