Hi John
I use this to find "dup" rows in my Hist table that are not exact duplicates.  
I am just checking key colums, I hope it helps.  
Marc

 EDIT ALL FROM tran_hist +
 WHERE (CTXT(custnum)+CTXT(tr_date)+ch_code+(CTXT(ch_price))+(CTXT +
 (ptest)) + (CTXT(date_frm))+ (CTXT(date_to))  ) IN  +
 (SELECT (CTXT(custnum)+ CTXT(tr_date)+ch_code+(CTXT(ch_price))+ +
 (CTXT(ptest)) +(CTXT(date_frm))+ (CTXT(date_to))  ), COUNT(*)  +
 FROM tran_hist +
 GROUP BY custnum,tr_date, ch_code,ch_price,ptest, date_frm,+
 date_to   HAVING COUNT (*) > 1)  +
 ORDER BY  tr_date,custnum,ch_code,ch_price,ptest, date_frm,date_to


      From: John Docherty <[email protected]>
 To: RBASE-L Mailing List <[email protected]> 
 Sent: Wednesday, April 22, 2015 7:26 AM
 Subject: [RBASE-L] - Detecting duplicate values in a table
   
<!--#yiv4097575692 _filtered #yiv4097575692 {font-family:"Cambria 
Math";panose-1:2 4 5 3 5 4 6 3 2 4;} _filtered #yiv4097575692 
{font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;}#yiv4097575692 
#yiv4097575692 p.yiv4097575692MsoNormal, #yiv4097575692 
li.yiv4097575692MsoNormal, #yiv4097575692 div.yiv4097575692MsoNormal 
{margin:0cm;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri", 
sans-serif;}#yiv4097575692 a:link, #yiv4097575692 
span.yiv4097575692MsoHyperlink 
{color:#0563C1;text-decoration:underline;}#yiv4097575692 a:visited, 
#yiv4097575692 span.yiv4097575692MsoHyperlinkFollowed 
{color:#954F72;text-decoration:underline;}#yiv4097575692 
span.yiv4097575692EmailStyle17 {font-family:"Calibri", 
sans-serif;color:windowtext;}#yiv4097575692 .yiv4097575692MsoChpDefault 
{font-family:"Calibri", sans-serif;} _filtered #yiv4097575692 {margin:72.0pt 
72.0pt 72.0pt 72.0pt;}#yiv4097575692 div.yiv4097575692WordSection1 {}-->I would 
appreciate some advice on how to detect duplicate values for a column in a 
table.  Apart from using a cursor to go through each row and then looking for 
rows with the same value is there any quicker way of doing this ?  Any 
suggestions would be appreciated.   Thank you.  Regards, John Docherty

  

Reply via email to