Subject Re: [firebird-support] Re: Update with data FROM a table
Author Aage Johansen
m_formigoni wrote:
> --- In, Magnus Titho
> <magnus.titho@k...> wrote:
>>update table1 t1
>>set t1.field1 =3D (select t2.field1 from table2 t2 where =3D
> ,
>>t1.field2 =3D (select t2.field2 from table2 t2 where =3D
>>This will either work or throw an error "multiple rows in singleton=20
>>select" if there is more than one matching record in table2.
> Yes, it works fine, but I'm looking for a way that I don't need to do
> "n" selects in the table2 (imagine updating 30 fields in table1 from
> table2, its costs goes very high).

This has been discussed on the Interbase/Firebird lists for years...
As for (very high) cost, after the first select most data will be in memory
(cache) so the next selects will probably not incur the overhead of
physical disk access.

Aage J.