RE: Update statement

RE: Update statement

 

  

He could, although in my experience, a subquery takes a lot longer to do
because query conditions have to be in two places:

UPDATE table1
Set table1.columm = newvalue
Where table1.key in (select table2.key from table2
where some condition is true)



Or

Create view deleteview as
Select * from table1, table2
Where table1.key = table2.key ****MUST BE PRIMARY UNIQUE KEY TO
WORK*****
And table2.key condition is true

Then you run:

Update deleteview
Set column = newvalue

Eric


-----Original Message-----
From: rbvogel
[mailto:oracledba-ezmlmshield-x42470418.[Email address protected]
Sent: Wednesday, November 30, 2005 11:09 AM
To: LazyDBA Discussion
Subject: RE: Update statement

Why don't you just use a subquery?

rbv


> No. However, you can create a VIEW which joins tables (which would
> need a primary key) and then you can us the update statement on the
VIEW.
>
> Eric
>
>
> -----Original Message-----
> From: Derrick Pitts
> [mailto:oracledba-ezmlmshield-x37445532.[Email address protected]
> Sent: Wednesday, November 30, 2005 9:20 AM
> To: LazyDBA Discussion
> Subject: Update statement
>
> Gurus,
>
> I need a little help with an update statement. I'm trying to create an

> update statement that joins a table. Will something like this work?
>
> update plmqa.ecs_activity
> (SELECT a.ecsactivities_uid
> FROM plmqa.ecs_task a, plmqa.ecs_activity b WHERE
> a.ecsactivities_uid = b.ecsactivities_uid
> AND UPPER (ecsactivities_subject) LIKE '%DELL%')
> SET ECSACTIVITIES_UPDATED_DATE = sysdate,
> ECSACTIVITIES_UPDATED_BY = '0',
> ECSACTIVITIES_STATUS = '0'
> where ECSACTIVITIES_STATUS = '1' and ECS_CREATED_BY = '0';
>
> Derrick Pitts, OCP
> Database Administrator
> Palm Harbor Homes, Inc.
> 972-764-9403
>
>
> --------
> website: http://www.LazyDBA.com
> Please don't reply to RTFM questions
> Oracle documentation is here: http://tahiti.oracle.com To unsubscribe:
> see http://www.lazydba.com/unsubscribe.html
> To subscribe: see http://www.lazydba.com By using this list you agree

> to these terms:http://www.lazydba.com/legal.html
>
>
>
> --------
> website: http://www.LazyDBA.com
> Please don't reply to RTFM questions
> Oracle documentation is here: http://tahiti.oracle.com To unsubscribe:

> see http://www.lazydba.com/unsubscribe.html
> To subscribe: see http://www.lazydba.com By using this list you agree

> to these terms:http://www.lazydba.com/legal.html
>


--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com To unsubscribe:
see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com By using this list you agree
to these terms:http://www.lazydba.com/legal.html


Oracle LazyDBA home page