Kovacs Zoltan writes:
> Maybe a trivial question, maybe it's foreign from SQL, I'dont know...
> How to add a column which stands for the row number in each row of the
> result? E.g.:
>
> row_no | column1 | column2 | ...
> ---+-+-+ ...
> 1 | datum11 | datum12 | ...
>
Kovacs Zoltan wrote:
>> Here is a method which is fairly cumbersome, but will do what you want.
>> (Whether what you want is useful, is another matter. The row numbers
>> have no meaning except to delineate which row is printed after which; they
>> bear no relation to their order in the t
Kovacs, Oliver,
First, thank you Oliver for the nice C program for this purpose. If
there doesn't turn out to be another method, it shoudl og in the
postgresql.org site.
However, Postgresql does have an internal row count for query results.
Otherwise LIMIT and OFFSET would not w
> Here is a method which is fairly cumbersome, but will do what you want.
> (Whether what you want is useful, is another matter. The row numbers
> have no meaning except to delineate which row is printed after which; they
> bear no relation to their order in the table.)
Thanks, Oliver! Are you su
Kovacs Zoltan wrote:
>> Use the "serial" column type.
>Unfortunately it's not what I expect. Assume that I have an arbitrary
>"SELECT expr1 as column1, expr2 as column2, ..." which gives
>
>column1 | column2 | ...
>+-+- ...
>..data..
>.
I was searching for the same thing, I couldn't found it though :(
-Original Message-
From: Kovacs Zoltan [mailto:[EMAIL PROTECTED]]
Sent: woensdag 11 april 2001 16:37
To: Poul L. Christiansen
Cc: [EMAIL PROTECTED]
Subject: Re: [SQL] enumerating rows
> Use the "serial
> Use the "serial" column type.
Unfortunately it's not what I expect. Assume that I have an arbitrary
"SELECT expr1 as column1, expr2 as column2, ..." which gives
column1 | column2 | ...
+-+- ...
..data..
I would like to get the same res
Use the "serial" column type.
create table myTable (row_no serial,column1 varchar(10),column2
varchar(20));
HTH,
Poul L. Christiansen
On Wed, 11 Apr 2001, Kovacs Zoltan wrote:
> Maybe a trivial question, maybe it's foreign from SQL, I'dont know...
> How to add a column which stands for the row