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 -> Slow Update!!

Slow Update!!

From: jsfromynr <jatinder.1975_at_gmail.com>
Date: 5 Jul 2006 08:57:45 -0700
Message-ID: <1152115065.714522.292270@m79g2000cwm.googlegroups.com>

Hello All,

I am trying to update a table where based on some condition I am creating a group. For that matter I used the Minimum rowid of the group in the column minrowid.

Update TableX X set minrowid =
(
Select min(rowid) from TableX Y where
X.Name=Y.Name
And X.City=Y.City
)

This table contains two or more rows for same combination of Name and City , so where clause is of no use.

I was thiking of using a intermediate table as

create table XYZ as
Select min(rowid) minrowid,Name,City from TableX group by Name,City

Then
Update TableX X set minowid=(Select minrowid from XYZ Y where X.Name=Y.Name
And X.City=Y.City
)

Will this Help!!!

As I am running the statement in Procedure , ORacle does not allow me to create table

Any Help is appreciated

With warm regards
Jatinder Singh Received on Wed Jul 05 2006 - 10:57:45 CDT

Original text of this message

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