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

Home -> Community -> Usenet -> c.d.o.server -> Re: Need subquery

Re: Need subquery

From: Noel <tomekb_XXXX__at_softman.pl>
Date: Mon, 28 Jun 2004 17:11:16 +0200
Message-ID: <40E03514.1040900@softman.pl>


Dnia 04-06-28 15:15, Uz.ytkownik Girivasan napisa?:
> I need a subquery require to copy a content into another table of same
> field names. The table1 having 100 records and table2 having 50
> records
> Query is :
> update stock1 t1 set t1.amt = (select t2.amt from stock2 t2 where
> t1.pr_no = t2.pr_no)
> The amt column is not null constraint,
> If running this query it shows Null value error
> What is the reason, explain me.

Your update updates all rows in table stock1. For rows where pr_no id doesn't exists in stock2 (t1.pr_no = t2.pr_no) it updates amt to null

--
TomekB
Received on Mon Jun 28 2004 - 10:11:16 CDT

Original text of this message

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