using a correlated subquery in update

From: Sean Davis <sdavis2(at)mail(dot)nih(dot)gov>
To: Postgres <pgsql-novice(at)postgresql(dot)org>
Subject: using a correlated subquery in update
Date: 2004-12-03 13:18:27
Message-ID: D1792BB0-452D-11D9-9DF2-000D933565E8@mail.nih.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I have a table that has a column that has values like XM_29832.11 and I
want to do an update to take off the .11 part. I can do this for a
single value using:

select substring('XM_29832.11' from '^([A-Z]*_[0-9*])');

However, how can I write an update to use the above as a subquery to
update the whole column at once?

Thanks,
Sean

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2004-12-03 16:15:07 Re: order by for user defined types
Previous Message Kjetil Haaland 2004-12-03 12:07:08 order by for user defined types