Connecting Tech Pros Worldwide Forums | Help | Site Map

How to get rid of duplicate value

didajosh's Avatar
Newbie
 
Join Date: Aug 2008
Posts: 29
#1: Jun 11 '09
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

Moderator
 
Join Date: Dec 2006
Location: Europe
Posts: 293
#2: Jun 15 '09

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.
amitpatel66's Avatar
Moderator
 
Join Date: Mar 2007
Location: Hyderabad, India
Posts: 2,192
#3: Jun 29 '09

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.
Newbie
 
Join Date: Dec 2008
Posts: 9
#4: Jul 10 '09

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 Oracle Database bytes