Re: Questions?
Posted in 1997
Gert Brinkmann wrote: > > Douglas Wilson wrote: > > > update table > > set field1= > > (select field1 from table1 > ^^^ > > where table.field1=table1.field1) > > Is there a "unique" missing between "select" and "field1" or is it not > required ? Depends on the data in table1. Actually now that I look at it, the whole statement seems rather pointless; if the tables join by field1 anyway, then you wouldn't have to set field1 in the first table to = field1 in the second table. But let's say you were doing this: update table set field1= (select field1 from table1 where table.field2=table1.field2) Then you'd need 'unique' if there were duplicate field1,field2 values in table1, and you'd get an error if there were duplicate field2 values with different field1 values. So it all depends on the data. Douglas Wilson