Re: auto-increment in a view

Поиск
Список
Период
Сортировка
От Willy-Bas Loos
Тема Re: auto-increment in a view
Дата
Msg-id 1dd6057e0909031003g3cc29977wec23c9942f010c1a@mail.gmail.com
обсуждение исходный текст
Ответ на Re: auto-increment in a view  (Raymond O'Donnell <rod@iol.ie>)
Список pgsql-general
> Just a wild notion, but would the generate_series function be any use to
> you?

Good idea, but i can't get it to work.

create or replace view testview3 as (
select generate_series(1,(select count(*) from test group by "value")), value
from test group by value);
select * from testview3 limit 5;
--ERROR:  more than one row returned by a subquery used as an expression

When i put the generate_series in the FROM clause, the results will be
matched "everything to everything".

I guess the windowing function is the way to go.

Thx,

WBL


--
"Patriotism is the conviction that your country is superior to all
others because you were born in it." -- George Bernard Shaw

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

Предыдущее
От: Adam Rich
Дата:
Сообщение: Re: auto-increment in a view
Следующее
От: Edoardo Panfili
Дата:
Сообщение: add a value to an ENUM type