Skip site navigation (1) Skip section navigation (2)

Re: Add a ROWCOUNT to the output of a select.

From: Marcin Stępnicki <mstepnicki(at)gmail(dot)com>
To: "Harald Fuchs" <hari(dot)fuchs(at)googlemail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Add a ROWCOUNT to the output of a select.
Date: 2008-05-14 08:48:34
Message-ID: 179149fe0805140148r49c2c5a3o5f944ce49b81049e@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-sql
On Wed, May 14, 2008 at 10:40 AM, Harald Fuchs
<hari(dot)fuchs(at)googlemail(dot)com> wrote:
> I think a sequence is much simpler:
>
> create temp sequence tmp;
> select nextval('tmp') as rownum,
>    contactdate
> from
>    myTable
> where
>    contactdate > '2007-06-30 23:59:59'
> order by
>    contactdate;

I used to do it this way myself, but the solution in my previous post
is really worth the trouble.

In response to

pgsql-sql by date

Next:From: Robins TharakanDate: 2008-05-14 10:01:54
Subject: Re: Add a ROWCOUNT to the output of a select.
Previous:From: Harald FuchsDate: 2008-05-14 08:40:17
Subject: Re: Add a ROWCOUNT to the output of a select.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group