X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 66179D7EC7 for ; Sat, 10 Sep 2005 13:48:43 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 51724-02 for ; Sat, 10 Sep 2005 16:48:41 +0000 (GMT) Received: from mailout10.sul.t-online.com (mailout10.sul.t-online.com [194.25.134.21]) by svr1.postgresql.org (Postfix) with ESMTP id 851F2D7ECE for ; Sat, 10 Sep 2005 13:48:40 -0300 (ADT) Received: from fwd19.aul.t-online.de by mailout10.sul.t-online.com with smtp id 1EE8Wt-0004mg-02; Sat, 10 Sep 2005 18:48:39 +0200 Received: from pD9F8CA31.dip.t-dialin.net (rffjROZa8e0a2xZxzO+Siwg2JPlgbwBbMTZWTzsiUzN5TV7EfTBLoz@[217.248.202.49]) by fwd19.sul.t-online.de with esmtp id 1EE8We-061yVt0; Sat, 10 Sep 2005 18:48:24 +0200 From: Michael Hoeller Reply-To: Michael Hoeller To: pgsql-sql@postgresql.org Subject: how to update with a join? Date: Sat, 10 Sep 2005 18:47:48 +0200 User-Agent: KMail/1.7.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200509101847.48765.MichaelHoeller@t-online.de> X-ID: rffjROZa8e0a2xZxzO+Siwg2JPlgbwBbMTZWTzsiUzN5TV7EfTBLoz X-TOI-MSGID: b322df11-8218-4c43-af83-2696bd0711b0 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 required=5 tests=[none] X-Spam-Level: X-Archive-Number: 200509/108 X-Sequence-Number: 22655 Hello I like to delete "k" from a string with the statement update stamm set code = replace (code, 'k' , ''); But the only way to get the canditates I want to update is the following statement. It seems that I can not update when I do a join. Is there a way around it? With google I found a hint that a subselect could help but there was no exsample ... And I did not found out how to do this. select a.code from stamm a where a.skart in ( (select skart from stamm where code like '%k%') ) and a.code not like '%V%'; I would be happy about a hint. Thanks a lot Michael