Re: same reseult set with less column

From: Ed Prochak <>
Date: Mon, 29 Sep 2008 13:36:02 -0700 (PDT)
Message-ID: <>

On Sep 29, 9:20 am, "" <> wrote:
> On Sep 28, 9:46 pm, Ed Prochak <> 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 :
> 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