RE: rowid value

  • From: "Ruel, Chris" <Chris.Ruel@xxxxxxx>
  • To: "Brian.Zelli@xxxxxxxxxxxxxxx" <Brian.Zelli@xxxxxxxxxxxxxxx>, "oracle-l (oracle-l@xxxxxxxxxxxxx)" <oracle-l@xxxxxxxxxxxxx>
  • Date: Tue, 5 Aug 2014 15:24:16 +0000

If I could assume you have access and the necessary predicates to identify the 
duplicate rows, you can just select out the ROWIDs and use the order by clause:

select rowid, department_name
from departments
order by rowid;

If you do not have the knowledge to design a predicate to identify the 
duplicate rows and you are only concerned with the two in your post, you could 
do something like this:

with rowids as (
select 'AAAocvACXAAAPFJAAa' from dual
union
select 'AAAocvACXAAAPFJAAb' from dual)
select *
from rowids
order by 1;

In the above example, I would say then the last rowid returned is the higher 
one.  I believe that is simply based on ascii sorting as you can see the last 
characters are a and b with b returning as the"higher" one.

Chris..



Chris Ruel * Oracle Database Administrator
cruel@xxxxxxx<mailto:cruel@xxxxxxx> * Desk:317.759.2172 * Cell 317.523.8482

From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx] On 
Behalf Of Zelli, Brian
Sent: Tuesday, August 05, 2014 11:07 AM
To: oracle-l (oracle-l@xxxxxxxxxxxxx)
Subject: rowid value

Another dba I'm covering for told me to delete a duplicate with the higher 
rowid?
Which one is the higher rowid?  AAAocvACXAAAPFJAAa or  AAAocvACXAAAPFJAAb?


Brian



This email message may contain legally privileged and/or confidential 
information. If you are not the intended recipient(s), or the employee or agent 
responsible for the delivery of this message to the intended recipient(s), you 
are hereby notified that any disclosure, copying, distribution, or use of this 
email message is prohibited. If you have received this message in error, please 
notify the sender immediately by e-mail and delete this email message from your 
computer. Thank you.
Notice of Confidentiality: **This E-mail and any of its attachments may contain
Lincoln National Corporation proprietary information, which is privileged, 
confidential,
or subject to copyright belonging to the Lincoln National Corporation family of
companies. This E-mail is intended solely for the use of the individual or 
entity to
which it is addressed. If you are not the intended recipient of this E-mail, 
you are
hereby notified that any dissemination, distribution, copying, or action taken 
in
relation to the contents of and attachments to this E-mail is strictly 
prohibited
and may be unlawful. If you have received this E-mail in error, please notify 
the
sender immediately and permanently delete the original and any copy of this 
E-mail
and any printout. Thank You.**

Other related posts: