Subject Re: [firebird-support] Re: Update query using multiple tables
Author Rich Pinder
Thanks Adam. Works GREAT !!

The data from this update is coming in from an external source; after
the loading, the RICHSELECT table is dropped. (so I wont offend
Codd&Date !)

Rich

Adam wrote:
>
> --- In firebird-support@yahoogroups.com, Rich Pinder <rpinder@...> wrote:
> >
> > I'm trying to accomplish a very simple update of one table, based on
> > values from another. (example data below)
>
> The following query should do it.
>
> update regtmp rt
> set rt.ccssid =
> (
> select rs.ccssid
> from richselect rs
> where rs.uscid = rt.uscid
> );
>
> But you may want to consider the design of your tables. A normalised
> database should not have duplicate data in that way. Why does regtmp
> need to hold ccssid when that information is (or seems to be) implied
> by uscid?
>
> Adam
> _,___