Re: Updating Help

From: JDoe <x_at_x.com>
Date: Tue, 26 Jun 2001 22:39:01 GMT
Message-ID: <2l3ijts4clrcqj8d2tr031lj0ir16m67hf_at_4ax.com>


Thanks,

our local DBA suggested a very similar query.. didn't feel right to me so I ended up using PLSQL cursors :)

Anyway, I can definately try this one out also.

thanks!
On 26 Jun 2001 15:13:16 GMT, catherine_devlin_at_purpleturtle.com wrote:

>
>update a
>set a.data =
> ( select b.src
> from b
> where a.id = b.id )
>where a.id in
> ( select b.id
> from b )
>
>Good luck!
>- Catherine
>
>In article <lct8jtsevvs6ak18org0m9dm7oc7884d8o_at_4ax.com>, JDoe <x_at_x.com>
>writes:
>>Hi,
>>
>>I have these tables in my database
>>
>>Table A
>>ID NUMBER(10)
>>DATA NUMBER(10)
>>
>>Table B
>>ID NUMBER(10)
>>SRC NUMBER(10)
>>
>>There is a one-to-one relationship between
>>A.ID and B.ID
>>
>>What I would like to do is "copy"
>>the contents of B.SRC to A.DATA wherever
>>A.ID = B.ID
>>
>>I can't quite make out the update
>>query for this. I know using cursors would
>>work but I'd like to avoid it if possible.
>>
>>thanks!
>
>
> ----- Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web -----
> http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
> NewsOne.Net prohibits users from posting spam. If this or other posts
>made through NewsOne.Net violate posting guidelines, email abuse_at_newsone.net
  Received on Wed Jun 27 2001 - 00:39:01 CEST

Original text of this message