Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Problem with update uses two tables

Re: Problem with update uses two tables

From: AW <wegiera_at_wp.pl>
Date: Wed, 12 Sep 2007 10:17:39 +0200
Message-ID: <fc87ja$9mu$1@nemesis.news.tpi.pl>


> I've had a problem with (probably) simple query. I want to update one
> field in one table when another field in this table is equal to
> another field in another table (they have the same type of course).
> This should be something like this (each table has two field - id and
> x):
>
> update tabX set tabX.x = tabY.y where tabX.id = tabY.id
> but it doesn't working...

use:
UPDATE tabX set x=(SELECT y FROM tabY WHERE tabY.id=tabX.id) WHERE ...

I think You are newbie, so check Your syntax before use.

---
AW 
Received on Wed Sep 12 2007 - 03:17:39 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US