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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Compare row ids

Re: Compare row ids

From: Walt <walt_askier_at_SHOESyahoo.com>
Date: Tue, 04 Oct 2005 09:50:43 -0400
Message-ID: <TMv0f.447$yb2.310@news.itd.umich.edu>


IANAL_VISTA wrote:
> "Robert Wehofer" <thalion77_at_graffiti.net> wrote :

>>Is it possible to compare row ids with each other?
>>
>>a.rowid > b.rowid
>>
>>is not the real solution due to string comparing.

> More importantly, what is the real problem?
> 
> Two different rows will each have a unique ROWID.
> IMO, comparing ROWIDs is nonsensical.

I find it quite useful when searching for duplicates in a table without a primary key

Select * from mytable t1, mytable t2
where t1.col1=t2.col1
and t1.rowid < t2.rowid

If course, it's far preferable to have a PK, but sometimes you inherit tables without one.

//Walt Received on Tue Oct 04 2005 - 08:50:43 CDT

Original text of this message

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