View previous topic :: View next topic
|
Author |
Message |
krunalbafna Warnings : 1 Active User
Joined: 18 Jan 2010 Posts: 143 Location: Pune
|
|
|
|
Hi,
following are my two tables: Table X and Table Y.
I want to update entry in table X on condition for number in table X matching Table Y.
COND: NO_tablex = No1_tableY
How shld be my query framed, May you help on this |
|
Back to top |
|
|
mallik4u
New User
Joined: 17 Sep 2008 Posts: 75 Location: bangalore
|
|
|
|
Hi,
what do you mean by NUMBER here.
Is that a column present in both the tables? |
|
Back to top |
|
|
krunalbafna Warnings : 1 Active User
Joined: 18 Jan 2010 Posts: 143 Location: Pune
|
|
|
|
Number is coloum which is present in both the table..
if the coloum value is same... we need to update the entry in TABLEX |
|
Back to top |
|
|
mallik4u
New User
Joined: 17 Sep 2008 Posts: 75 Location: bangalore
|
|
|
|
then you can try the following query
UPDATE X
SET <COLUMN NEEDS TO BE CHANGED> = <DESIRED VALUE>
WHERE NUMBER IN (SELECT NUMBER FROM Y)
Above query will update for all the matching NUMBER col values. If you want it to be done for specific then you may need to add WHERE clause to the inner query. |
|
Back to top |
|
|
|