pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Poul L. Christiansen <poulc@cs.auc.dk>
To: Kovacs Zoltan <kovacsz@pc10.radnoti-szeged.sulinet.hu>
Cc: pgsql-sql@postgresql.org
Subject: Re: enumerating rows
Date: Wed, 11 Apr 2001 15:29:39 +0200 (MEST)
Message-ID: <Pine.GSO.4.21.0104111526560.17444-100000@borg.cs.auc.dk> (raw)
In-Reply-To: <Pine.LNX.4.21.0104111357510.3543-100000@pc10.radnoti-szeged.sulinet.hu>

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 number in each row of the
> result? E.g.:
> 
> row_no | column1 | column2 | ...
> -------+---------+---------+ ...
>      1 | datum11 | datum12 | ...
>      2 | datum21 | datum22 | ...
>    ... |     ... |     ... | ...
> 
> I didn't find anything in the docs.
> 
> TIA, Zoltan
> 
> -- 
>                          Kov\'acs, Zolt\'an
>                          kovacsz@pc10.radnoti-szeged.sulinet.hu
>                          http://www.math.u-szeged.hu/~kovzol
>                          ftp://pc10.radnoti-szeged.sulinet.hu/home/kovacsz
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
> http://www.postgresql.org/search.mpl
> 




view thread (12+ messages)  latest in thread

Message-ID: <Pine.GSO.4.21.0104111526560.17444-100000@borg.cs.auc.dk>
Permalink:  ../Pine.GSO.4.21.0104111526560.17444-100000@borg.cs.auc.dk/
Also on:    postgresql.org/message-id/Pine.GSO.4.21.0104111526560.17444-100000@borg.cs.auc.dk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: poulc@cs.auc.dk, kovacsz@pc10.radnoti-szeged.sulinet.hu
  Subject: Re: enumerating rows
  In-Reply-To: <Pine.GSO.4.21.0104111526560.17444-100000@borg.cs.auc.dk>
  References: <Pine.LNX.4.21.0104111357510.3543-100000@pc10.radnoti-szeged.sulinet.hu> <Pine.GSO.4.21.0104111526560.17444-100000@borg.cs.auc.dk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox