Connecting Tech Pros Worldwide Help | Site Map

How to get rid of duplicate value

  #1  
Old June 11th, 2009, 03:52 PM
didajosh's Avatar
Newbie
 
Join Date: Aug 2008
Posts: 28
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
  #2  
Old June 15th, 2009, 09:39 AM
Moderator
 
Join Date: Dec 2006
Location: Europe
Posts: 290

re: How to get rid of duplicate value


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.
  #3  
Old June 29th, 2009, 09:17 AM
amitpatel66's Avatar
Moderator
 
Join Date: Mar 2007
Location: Hyderabad, India
Posts: 2,188

re: How to get rid of duplicate value


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.
  #4  
Old July 10th, 2009, 10:56 PM
Newbie
 
Join Date: Dec 2008
Posts: 9

re: How to get rid of duplicate value


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 ...
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting rid of duplicate tables. Jared Carr answers 12 November 22nd, 2005 08:41 AM
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit answers 0 November 14th, 2005 07:46 PM
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit answers 0 November 14th, 2005 03:55 PM
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit answers 5 November 14th, 2005 12:36 PM