Re: returned row number

Поиск
Список
Период
Сортировка
Искать
От
Keith Worthington
Тема
Re: returned row number
Дата
в 18:00:27
Msg-id
20050506205935.M94900@narrowpathinc.com
Ответ на
Re: returned row number (Bruno Wolff III)
Список
Дерево обсуждения
returned row number "Keith Worthington" <keithw@narrowpathinc.com>
Re: returned row number Bruno Wolff III <bruno@wolff.to>
Re: returned row number "Keith Worthington" <keithw@narrowpathinc.com>
Re: returned row number "Celia McInnis" <celia@drmath.ca>
convert from epoch to timestamp "Celia McInnis" <celia@drmath.ca>
Re: convert from epoch to timestamp Bruno Wolff III <bruno@wolff.to>
Re: returned row number Bruno Wolff III <bruno@wolff.to>
On Fri, 6 May 2005 16:00:16 -0500, Bruno Wolff III wrote
> On Fri, May 06, 2005 at 15:45:02 -0400,
>   Keith Worthington  wrote:
> > Hi All,
> > 
> > I have a quick question.  Is there a simple way to access
> > the returned record number?
> > 
> > I want to be able to do something like
> > 
> > SELECT record AS record_no,
> >        column1,
> >        column2
> >   FROM table1
> >  WHERE column2 < 100
> >  ORDER BY column1;
> > 
> > record_no | column1 | column2
> > ----------+---------+---------
> > 1         | A       | 1.75
> > 2         | F       | 93
> > 3         | M       | 12.5
> > 4         | N       | 0
> > 5         | Q       | 57.6
> 
> Normally the best thing to do is have the application count.
> You can use a subquery to get the counts, but it will be a
> lot slower. You could also write a set returning function
> to do this.
> 

This query is actually in a SRF.

Can you suggest how to proceed?

Kind Regards,
Keith
В списке pgsql-novice по дате отправления
От: Bruno Wolff III
Дата:
Сообщение: Re: returned row number
От: Celia McInnis
Дата:
Сообщение: Re: returned row number
FAQ