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: updating record question

Re: updating record question

From: Glynn Taylor <glynntaylor_at_hotmail.com>
Date: Thu, 23 Dec 1999 20:42:32 -0000
Message-ID: <83u17h$rvj$1@plutonium.btinternet.com>


Joe,

To do an update of this kind you will have to use a sub query e.g

update emp E
set dname = (select dname from dept where deptno = (select deptno from emp_dept B where E.empno = B.empno));

I hope this helps

Glynn

Joe D <joed_at_icoms.com> wrote in message news:3862864b$1_at_News.Destek.net...
> I have the following query which gives me the following output.
>
> select s.key_store_seqid "store id", t.order_number "order numb",
> t.order_status "status"
> 2> from store s, txorder t
> 3> where
> 4> s.store_id = t.store_id
> 5> and t.order_number < 100008
> 6> and t.order_number >= 100000
> 7> and s.key_store_seqid = 500513
> 8>
> store id order numb status
> ---------- ---------- ----------
> 500513 100000 2
> 500513 100001 2
> 500513 100002 2
> 500513 100003 2
> 500513 100004 2
> 500513 100005 2
> 500513 100006 2
> 500513 100007 2
> 8 rows selected.
>
> What I need to update is the status column. I need to change the 2 to a 4.
I
> am having problems
> with the query syntax. I'm a newbie to sql queries and I'm not sure how to
> join the two tables in a update query.
> Any help would be great.
>
> Thanks and Happy Holidays.
>
> Joe
>
>
Received on Thu Dec 23 1999 - 14:42:32 CST

Original text of this message

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