Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Compare row ids
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