Re: Interpolation problem - pg 12.4 - full correct version!

Поиск
Список
Период
Сортировка
От Pól Ua Laoínecháin
Тема Re: Interpolation problem - pg 12.4 - full correct version!
Дата
Msg-id CAF4RT5RuDTqpgHyjkzUiju08KibCiO+LY+rqejrF8j+fS-59FA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Interpolation problem - pg 12.4 - full correct version!  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
Hi,

>> So, my question is: Is there a recognised technique (using SQL only,
>> not PL/pgSQL - soutions based on the latter are easy to find) whereby
>> I can do a basic Linear Interpolation?

> I don't have a recognized technique, nor care to ponder one right now, but what you've described would best be done
inpure SQL using WITH RECURSIVE, which provides an iterative approach to SQL result building.  Which is more commonly
donein a procedural language.  The algorithm you describe is an iterative algorithm and so I'm wondering why place the
arbitraryrestriction on using pure SQL when it likely wouldn't provide a very readable nor performant solution relative
toa procedural (pl/pgsql or otherwise) one? 

Well, it would be trivial to do something with PL/pgSQL (just Google
and download the code - there are a few examples around).

I''m a big fan of this site https://explainextended.com/ - this guy
can do anything with SQL - I'd like to try and learn how to do the
same.

You're idea of RECURSIVE is exactly along the lines I was thinking of
- I'll persevere and see what I can come up with using WITH RECURSIVE
- I've use it before.

Thanks for your input and rgs,


Pól...


> David J.



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

Предыдущее
От: Michael Lewis
Дата:
Сообщение: Re: Window functions speed
Следующее
От: Pól Ua Laoínecháin
Дата:
Сообщение: Re: Interpolation problem - pg 12.4 - full correct version!