Re: row numbering

Поиск
Список
Период
Сортировка
От josue
Тема Re: row numbering
Дата
Msg-id 4224B3DC.8070203@lamundial.hn
обсуждение исходный текст
Ответ на Re: row numbering  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
Список pgsql-general
I figured it out, maybe is not the most elegant way but it work for my
case where only small sets are retrieved

create table foo2 (pk int, valor numeric(12,2), porce numeric(5,2));

insert into foo2 values (1,7893.45,0.4);
insert into foo2 values (5,7893.45,0.3);
insert into foo2 values (9,7893.45,0.3);

select *,
(select count(*) from foo2 as f2
where f2.oid <= foo2.oid) as counter
from  foo2;


--
Sinceramente,
Josué Maldonado.

... "Un científico es un hombre tan endeble y humano como cualquiera;
sin embargo, la búsqueda científica puede ennoblecerle, incluso en
contra de su voluntad." -- Isaac Asimov

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Index size
Следующее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: Fast major-version upgrade (was: postgresql 8.0 advantages)