Re: new calculated column

From: <mallah(at)trade-india(dot)com>
To: <andresjavier(dot)garcia(at)wanadoo(dot)es>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: new calculated column
Date: 2002-09-05 18:49:22
Message-ID: 58553.203.145.129.36.1031251762.squirrel@mail.trade-india.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


HI.

simple (tedious) solution would be do fire 20 sqls.


update tabel set f1=<some int 1> where f2='some varchar1';
update tabel set f1=<some int 2> where f2='some varchar2';
update tabel set f1=<some int 3> 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/

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Linn Kubler 2002-09-05 22:15:02 Character translation?
Previous Message Ligia Pimentel 2002-09-05 17:29:47 Re: Update help