Subject | RE: [firebird-support] Updating with inner join - noobie help needed |
---|---|
Author | Alan McDonald |
Post date | 2006-04-04T21:09:18Z |
>use barckets ans the SELECT key word
> Can someone please tell me what is wrong with this query.
>
> UPDATE VT_TR_TABLE
> SET VT_TR_TABLE.DISTRI = VT_TR_CABLE_TABLE.CA FROM VT_TR_TABLE INNER
> JOIN VT_TR_CABLE_TABLE ON
> VT_TR_TABLE.MASTER_KEY = VT_TR_CABLE_TABLE.MASTER_KEY;
>
> When I try to run it it gives the following error.
>
> Token unknown FROM
>
> The query is supposed to update DISTRI to CA where the two master
> keys match.
>
> Thanks for your help
> Lin
>
> UPDATE VT_TR_TABLEINNER
> SET VT_TR_TABLE.DISTRI = (select VT_TR_CABLE_TABLE.CA FROM VT_TR_TABLE
> JOIN VT_TR_CABLE_TABLE ONyou may need to control the number of records updated though and watch for
> VT_TR_TABLE.MASTER_KEY = VT_TR_CABLE_TABLE.MASTER_KEY);
duplicates.. SELECT FIRST 1 may be required also.
Alan