Subject | Re: update from 2 tables |
---|---|

Author | cbll_lam |

Post date | 2006-06-23T09:33:28Z |

Svein Erling Tysvaerwrote:

it work, because I'm not good in working with subquery.

Will it fail if 2 different alias not set for tableB?

eg.

update a

set a.p=(select b.q from b where b.y=a.x)

where exists(select 1 from b where b.y=a.x)

Which method, this and the SP suggested by Adam, is faster? I meant

execution speed for larger table.

regards,

bill

> update TableA aThank you all! I test it works although I still do not understand why

> set a.p=(select b.q from TableB b where b.y=a.x)

> where exists(select * from TableB c where c.y=a.x)

it work, because I'm not good in working with subquery.

Will it fail if 2 different alias not set for tableB?

eg.

update a

set a.p=(select b.q from b where b.y=a.x)

where exists(select 1 from b where b.y=a.x)

Which method, this and the SP suggested by Adam, is faster? I meant

execution speed for larger table.

regards,

bill