How to get rid of duplicate value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • didajosh
    New Member
    • Aug 2008
    • 47

    How to get rid of duplicate value

    This is a report for Payroll.
    After doing a LOT of work on various tables, doing SUM and Left join, I have achieved the following result:

    ID-----NAME------POS-ID--JOB-DESC--------EARNINGS---------EMP-SUM
    01------DJ------------02--------READER----------100---------------10
    01------DJ------------02--------WRITER-----------122---------------10
    02------JM------------03--------CALLER-----------200---------------50
    03------ND------------05--------GUARD-----------150----------------25


    Sum of Earning comes from a separate table, and its added by Group BY POS-ID.
    EMP-SUM comes from a separate table, and its added by Group BY ID. It has no other criteria.
    As you can see, EMP-SUM in 2nd row is being repeated for ID-01.
    Is there some way I can get rid of the repeated EMP-SUM.

    If all this sounds very bizarre, please ask me more questions about this.
    I am very confused and I will be more than happy to assist you find a solution for me :)

    Thanks!

    Dipali
  • rski
    Recognized Expert Contributor
    • Dec 2006
    • 700

    #2
    I'm not sure if i understand what do you want to achieve. Can you show how do you want the result look like cos EMP-SUM is repeated but not whole row is repeated. If you remove the duplicated EMP-SUM what do you think should be put into JOB-DESC and EARNINGS columns.

    Comment

    • amitpatel66
      Recognized Expert Top Contributor
      • Mar 2007
      • 2358

      #3
      Dipali,

      Thanks for the sample data.
      Can you post the query that you are using for data fetch?

      When you say duplicates, all the columns should have same values for more than one record. But in the sample data that you have provided above, I DO NOT see any duplicate data.

      It would be great if you can explain your requirement further in detail.

      Comment

      • asp2
        New Member
        • Dec 2008
        • 10

        #4
        you can get rid of this duplication , if you really need this , by creating a new table having columns ID , EMP-SUM ,
        and remove EMP-SUM column from this table ...

        hope this helps ...

        Comment

        Working...