How can I use this subselect properly in an update?

From: John Tuliao <jptuliao(at)eglobalreach(dot)net>
To: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: How can I use this subselect properly in an update?
Date: 2012-02-17 07:52:13
Message-ID: 4F3E072D.8030806@eglobalreach.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

select
substring(t1.called_number from t2.offset),
t1.called_number
from
calls_join as t1,
john_prefix as t2
where
strpos(t1.called_number, t2.prefix) = '1'
order by length(t2.prefix) desc limit '1' ;

I'm having trouble using this as a sub-select in an UPDATE. Most of the
time it works. Then sometimes it doesn't.
Is there an issue with possible NULL values that can be found on table1
(t1)?

Browse pgsql-sql by date

  From Date Subject
Next Message Jan Eskilsson 2012-02-17 12:12:41 hstore and populate_record
Previous Message Amila Jayasooriya 2012-02-17 07:19:15 cast type bytea to double precision