Re: sum of a column (development question)

  • From: "Andrew Kerber" <andrew.kerber@xxxxxxxxx>
  • To: gspier@xxxxxxxxxxx
  • Date: Wed, 12 Sep 2007 09:48:12 -0500

Well, I see your point but ntile divides the data into a number of groups
based on an argument in you give it.  He  wants the data from this year and
last year, and the between statement with a group by, order by is the
logical way to get that, without any recoding required.  The use of ntile
would not only be redundant, but require an additional calculation to
determine the number of buckets to use.  If he wants to modify the sql to
allow quarterly or monthly data, a roll up would do that without requiring
additional calculations to determine the number of groupings needed.

On 9/12/07, August Spier <gspier@xxxxxxxxxxx> wrote:
> Perhaps I am mistaken.  use of analytic functions will leave the developer
> with a way forward if/when the requirements change (two years, three years,
> by quarter, whatever) and prevent the need to recode.  In addition, the
> exercise strengthens the developer's ability with analytic functions.
> It's only a suggestion ...
> r,
> Gus
> On Sep 12, 2007, at 8:51 AM, Andrew Kerber wrote:
> You lost me on that one.  How would ntile apply when he just wants totals
> for this year and last year?
> On 9/11/07, August Spier < gspier@xxxxxxxxxxx> wrote:
> >
> > I was under the impression that NTILE would be more useful ...
> > especially if you are in a development cycle and requirements for more sql
> > statements are going to surface.
> > See 
> >
> >
> >
> > r,
> >
> > Gus
> >
> >

Andrew W. Kerber

'If at first you dont succeed, dont take up skydiving.'

Other related posts: