04-07-2008 10:42 AM
Hi,
I created a database view with 2 fields each from two table with no join condition. There are duplicate entries in the view as there is no join condition. My requirement is to remove that duplicate entries.
table A
CCode Sales Division
C1 S1 D1
C1 S1 D2
C1 S1 D3
Table B
CCode Plant Status
C1 P1 X
C1 P2 X
View
Sales Plant
S1 P1
S1 P2
S1 P1
S1 P2
S1 P1
S1 P2
I want to delete these duplicate records.
Regards
Suresh
04-07-2008 10:43 AM
04-07-2008 10:50 AM
Hi ,
There are 2 cases.
If your requirement is to delete duplicate entries during your flow logic simply use DELETE ADJACENT DUPLICATE COMPARING. ( Check syntax).
2nd If you want to delete from view itself . Just design a simple program which selects the data form this view into a internal table. Sort this internal table. Move into another table with of same structure.Delete adjacent duplicates from 2nd internal table. Comapre the data in both tables . If valuse does not match ..just delete them.
Reward if helpful!!
Regards
Sourabh
04-07-2008 11:01 AM
Hi Sourabh,
Thanks for your reply.
The second solution you proposed is not possible. I want to delete this in the flow logic itself. So can i use the delete duplicate record statement? If so where?
Regards
Suresh
04-08-2008 6:51 AM
Hi,
Delete the duplicates entries once you have taken all the entries in the internal table.
Please make sure that you sort the internal table by primary key before deleting the records.
regards
Sourabh