Home » SQL & PL/SQL » SQL & PL/SQL » Check Duplicate Row in a Table (Oracle10g)
Check Duplicate Row in a Table [message #293474] Sun, 13 January 2008 02:18 Go to next message
ednms
Messages: 39
Registered: November 2007
Member
Hi, I has this list of records

Quote:

TXN_ID_NUM POC_CODE MACHINE_NO TXN_AMT ACCT_NO
---------------------- ---------- ---------- ---------------------- --------------
1039302 1209 01 418 20060280796607
1039303 1209 01 380.8 Z921851700103
1039305 1209 01 418 20060280796607
1039306 1209 01 650.5 P921851700103
1039307 1209 01 47 P921851700103
1039308 1209 01 47 P921851700103
How can i check duplicate on
POC_CODE
,MACHINE_NO
,TXN_AMT
,ACCT_NO
for each TXN_ID_NUM

for example TXN_ID_NUM 1039302 has duplicate
POC_CODE
,MACHINE_NO
,TXN_AMT
,ACCT_NO
with TXN_ID_NUM 1039305

I try this and it's work but i'm afraid about the performance
if the volume is high.

select * from NPCS_INPUT_TXN T2 
where T2.TXN_ID_NUM = 1039302
and (
T2.POC_CODE                 
,T2.MACHINE_NO              
,T2.TXN_AMT                       
,T2.ACCT_NO) in (
select 
T2.POC_CODE                 
,T2.MACHINE_NO              
,T2.TXN_AMT                       
,T2.ACCT_NO   
from NPCS_INPUT_TXN T2
where T2.TXN_ID_NUM <> 1039302)

Any opinion?
Thanks.

[Updated on: Sun, 13 January 2008 02:21]

Report message to a moderator

Re: Check Duplicate Row in a Table [message #293478 is a reply to message #293474] Sun, 13 January 2008 02:43 Go to previous message
Michel Cadot
Messages: 64133
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
As this is a question that is asked almost once per week, I think I suggest you to search and lock the topic.

Regards
Michel
Previous Topic: Index by clause in collections
Next Topic: Promlem in creating user
Goto Forum:
  


Current Time: Thu Dec 08 04:30:34 CST 2016

Total time taken to generate the page: 0.08015 seconds