Re: SQL challenge--top 10 for each key value?

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: SQL challenge--top 10 for each key value?
Дата
Msg-id 871xmvf7sz.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Re: SQL challenge--top 10 for each key value?  (elein <elein@varlena.com>)
Ответы Re: SQL challenge--top 10 for each key value?
Список pgsql-sql
elein <elein@varlena.com> writes:

> create or replace function pycounter(integer)
> returns integer as
> '
>    if args[0] == 0:
>       SD["nextno"] = 1
>       return SD["nextno"]
>    try:
>       SD["nextno"] += 1
>    except:
>       SD["nextno"] = 1
>    return SD["nextno"]
> ' language 'plpythonu';
> 
> And clearly it can be done faster as a little
> C function.

Does this approach have a hope of working if it's used twice in the same
query?


-- 
greg



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

Предыдущее
От: elein
Дата:
Сообщение: Re: SQL challenge--top 10 for each key value?
Следующее
От: Bret Hughes
Дата:
Сообщение: trigger/for key help