Re: Updating values from one table to another..plz help

From: <aupadhya_at_bbn.com>
Date: Fri, 09 Oct 1998 15:03:05 GMT
Message-ID: <6vl8j9$gh5$1_at_nnrp1.dejanews.com>


In article <6vg1ba$7ld_at_news1.sjc.in.sel.sony.com>,   "MN" <mirek1_at_hotmail.com> wrote:
> Hi,
>
> I have two tables. Table A contains four columns:
> firstname,lastname, pager and phone; table B contains firstname,
> lastname and pager. I want to transfer all pager numbers
> from table B to A based on the matching firstnames
> and lastnames. I've been working for days on this query
> but can't get it to work. Can someone please help me out ?
> How would the "update A set pager =..." look?
>
> I have made both tables unique on firstname and lastname.
>
> Thank you.
>
> Eric
>
>

Try following update staement

UPDATE A SET A.PAGER = (SELECT B.PAGER FROM B WHERE A.LAST_NAME = B.LAST_NAME AND A.FIRST_NAME = B.FIRST_NAME) This must work as expected.

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Fri Oct 09 1998 - 17:03:05 CEST

Original text of this message