Received: from mailhost.cs.auc.dk (mailhost.cs.auc.dk [130.225.194.2]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f3BDUE865651 for ; Wed, 11 Apr 2001 09:30:14 -0400 (EDT) (envelope-from poulc@cs.auc.dk) Received: from borg.cs.auc.dk (poulc@borg.cs.auc.dk [130.225.194.22]) by mailhost.cs.auc.dk (8.9.3/8.9.3) with ESMTP id PAA12746; Wed, 11 Apr 2001 15:29:39 +0200 (MET DST) Date: Wed, 11 Apr 2001 15:29:39 +0200 (MEST) From: "Poul L. Christiansen" To: Kovacs Zoltan cc: pgsql-sql@postgresql.org Subject: Re: enumerating rows In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200104/156 X-Sequence-Number: 2504 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 >