If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Deleting duplicate rows in a table

Started by elisha, 21 Sep 2005 05:22:35 PM

Previous topic - Next topic

elisha

How to completely deleteÃ,  duplicate rows? while I'm working with FM ?Ã, 
for exampleÃ,  i have table like thisÃ, 

JobidÃ,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  JobnameÃ,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  commission
00001Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  managerÃ,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  5000
00002Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  assistantÃ,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, 4000
00003Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  ClarkÃ,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  3000Ã,  Ã, 
00001Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  managerÃ,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  7000

Jobid & jobname is repeated.
more over i dint have any primary & foreign key.Ã, 


sir_jeroen

what about the comission? That's not the same...
You can use grouping:

select jobid, jobname, max(commission) as Commission from tableA group by jobid, jobname

or AVG / MIN instead of max()

This should do the trick.. but be carefull..

It's all full of tricks.. especially when it's time/date related....

So, maybe you can better post the full table definition...



Merri

It also depends what's causing the duplication. If the "commission" field is different, is this because of a genuine additional transaction, or it is a modification of the original transaction? If you're using SCDs, do you need to filter on the current record indicator?

As ReportNet Addict said, we need more information about your data.

elisha

Thank you
Can you explain how to group Query items in FM?. 

sir_jeroen

You have to use native / pass-through SQL in your database query subject.
and type in the grouped sql.

bdybldr

That isn't exactly a duplicate row because commission is different.   Is that simply an oversight or are these actual number?  Which record do you want to use?  Please explain the results that you're looking for.