Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 682D1476B36 for ; Thu, 5 Sep 2002 14:49:23 -0400 (EDT) Received: from www.trade-india.com (news1.trade-india.com [130.94.20.27]) by postgresql.org (Postfix) with SMTP id B63F4476B2B for ; Thu, 5 Sep 2002 14:49:21 -0400 (EDT) Received: (qmail 30370 invoked by uid 99); 5 Sep 2002 18:49:22 -0000 Received: from 203.145.129.36 (proxying for 203.145.131.140) (SquirrelMail authenticated user mallah) by mail.trade-india.com with HTTP; Fri, 6 Sep 2002 00:19:22 +0530 (IST) Message-ID: <58553.203.145.129.36.1031251762.squirrel@mail.trade-india.com> Date: Fri, 6 Sep 2002 00:19:22 +0530 (IST) Subject: Re: new calculated column From: To: In-Reply-To: <200209051657.g85Gvei20144@natura.cebas.csic.es> References: <200209051657.g85Gvei20144@natura.cebas.csic.es> X-Priority: 3 Importance: Normal X-MSMail-Priority: Normal Cc: X-Mailer: SquirrelMail (version 1.2.6) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/28 X-Sequence-Number: 9305 HI. simple (tedious) solution would be do fire 20 sqls.  update tabel set f1= where f2='some varchar1'; update tabel set f1= where f2='some varchar2'; update tabel set f1= where f2='some varchar3'; incase there is some the integer is a function of varchar u may translate to the corresponding SQL. regds mallah. > Hi; > > I've got a table with two fields and about 3000 rows, the second one is a character field, what > can have about twenty different values; of course these values are repeated a lot of times in > the table. I need to create a new column of type integer, whose value depens on the character > fields. The values of the new column are not important, the important thing is who can I create > this column and assign a different integer to a different char value in the other column. > Thanks > -------------- > Javier > > ------------------------------------------------------- > > ---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' > the postmaster ----------------------------------------- Get your free web based email at trade-india.com. "India's Leading B2B eMarketplace.!" http://www.trade-india.com/