Re: need some help on figuring out how to write a query

Поиск
Список
Период
Сортировка
От Jorge Godoy
Тема Re: need some help on figuring out how to write a query
Дата
Msg-id 200802231047.44377.jgodoy@gmail.com
обсуждение исходный текст
Ответ на Re: need some help on figuring out how to write a query  (Justin <justin@emproshunts.com>)
Список pgsql-general
Em Friday 22 February 2008 13:10:20 Justin escreveu:
> I'm not after small code i'm after maintainable code where the date
> range for this report would be always changing.  So if i can get it to
> one select statement i would on have to pass in some variables and it
> would create the moving average.  Plus what if the sales people decide
> they want to change moving average from 10 weeks to 5 weeks or change it
> to 15 weeks.   People drive me nuts with i want it to do this or that ,
> Of course they have no idea how complicated it sometimes to get what
> they want.

Then just add more parameters to your function.  Instead of just start date
also include an optional period, in weeks, days, hours, whatever you think is
the better granularity for this.

So, in your interface, add the period and make "10" the default value.



--
Jorge Godoy      <jgodoy@gmail.com>


В списке pgsql-general по дате отправления:

Предыдущее
От: "Kynn Jones"
Дата:
Сообщение: Re: PostgreSQL's hashing function?
Следующее
От: "Osvaldo Kussama"
Дата:
Сообщение: Re: joining on concatonation?