two field table: field1, field2, how to add a third one with the auto-generated value replace(field2,'channel','AAAA')?

From: zxo102 ouyang <zxo102(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: two field table: field1, field2, how to add a third one with the auto-generated value replace(field2,'channel','AAAA')?
Date: 2009-12-13 02:05:44
Message-ID: 73ccced30912121805s69678637hfea4bf515d9d5597@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi evreyone,
I have a table with two fields

field1 field2
1 1channel
2 2channel
3 3channel

Now I want to add the third one with the value
replace(field2,'channel','AAAA') like

field1 field2 field3
1 1channel replace(field2,'channel','AAAA')
2 2channel replace(field2,'channel','AAAA')
3 3channel replace(field2,'channel','AAAA')

The field3 must be done automatically after a user input data into field1
and field2.

Any ideas? Thanks a lot.

ouyang

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2009-12-13 04:03:29 Re: two field table: field1, field2, how to add a third one with the auto-generated value replace(field2,'channel','AAAA')?
Previous Message Adrian Klaver 2009-12-12 22:54:59 Re: how can i change encoding in template1 DB?