this query gives me the result
delete FROM VSE_MigrationTest..audcallrecords WHERE callid=(SELECT
MIN(callid) FROM MigrationTest..audcallrecords as T WHERE
MigrationTest..audcallrecords.callid= T.callid and
MigrationTest..audcallrecords.line = T.line and
MigrationTest..audcallrecords.system = T.system having count(*) > 1)
[quoted text, click to view] "vanitha" wrote:
> hi friends,
>
> my table struct is
>
> callid line system duration
> 12 7 1 120
> 12 7 1 500
> 12 6 1 240
>
> i want to implement composite pk on this table for the columns
> (callid,line,system)
> so first i shd eliminate the duplicates i.e delete the duplicate values
>
> my query for pk is
>
> delete FROM callrecords
> WHERE callid =
> (SELECT MIN(callid)
> FROM audcallrecords as T
> WHERE audcallrecords.callid = T.callid
> HAVING COUNT(*)>1)
>
> this works if the table is holding 1 column pk.
>
> how to do this for composite pk?
>
> pls help me to solve this.
>
> thanks
> vanitha
>