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

From: John Strange <jstrange_at_imtn.dsccc.com>
Date: 7 Oct 1998 17:49:08 GMT
Message-ID: <6vg9ik$e9e$1_at_relay1.dsccc.com>


update a_table a
set pager = (select pager

	       from b_table b
	      where a.firstname = b.firstname
	        and a.lastname = b.lastname
	    )

where a.firstname = b.firstname
  and a.lastname = b.lastname
/

Second where clause is needed to keep from nulling rows in a_table that are not in b_table.

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

--
While Alcatel may claim ownership of all my ideas (on or off the job),
Alcatel does not claim any responsibility for them. Warranty expired when u
opened this article and I will not be responsible for its contents or use.
Received on Wed Oct 07 1998 - 19:49:08 CEST

Original text of this message