Hi ,
Thanks for your response. Yes, the query is a little overstated and thanks for simplifying it.
Please find the complete query that i was running below. I have total of 15 columns and the duplicate keys are 6 :
SELECT A.GR,A.DT,A.FA,A.ERID,A.HID,A.OE,A.LOE,A.OBE,A.OBT,A.STE,A.CLD,A.GI,A.LT,A.RE,A.HTLT
FROM
(SELECT A.GR,A.DT,A.FA,A.ERID,A.HID,A.OE,A.LOE,A.OBE,A.OBT,A.STE,A.CLD,A.GI,A.LT,A.RE,A.HTLT
FROM
ADE.OBSN_E) A
INNER JOIN
(SELECT DISTINCT GR,GI,OE,LOE,OBE,CLD
FROM ADE.OBSN_E
GROUP BY
GR,GI,OE,LOE,OBE,CLD
HAVING COUNT(*)>1) B
ON
A.GR=B.GR AND
A.GI=B.GI AND
A.OE=B.OE AND
A.LOE=B.LOE AND
A.OBE=B.OBE AND
A.CLD=B.CLD
In the format mentioned by you :
SELECT A.* FROM
ADE.OBSN_E A
INNER JOIN
(
SELECT GR,GI,OE,LOE,OBE,CLD
FROM ADE.OBSN_E
GROUP BY GR,GI,OE,LOE,OBE,CLD
HAVING COUNT(*)>1
) B
ON
A.GR=B.GR AND
A.GI=B.GI AND
A.OE=B.OE AND
A.LOE=B.LOE AND
A.OBE=B.OBE AND
A.CLD=B.CLD
Hi ,
Thanks for your response. Yes, the query is a little overstated and thanks for simplifying it.
Please find the complete query that i was running below. I have total of 15 columns and the duplicate keys are 6 :
SELECT A.GR,A.DT,A.FA,A.ERID,A.HID,A.OE,A.LOE,A.OBE,A.OBT,A.STE,A.CLD,A.GI,A.LT,A.RE,A.HTLT
FROM
(SELECT A.GR,A.DT,A.FA,A.ERID,A.HID,A.OE,A.LOE,A.OBE,A.OBT,A.STE,A.CLD,A.GI,A.LT,A.RE,A.HTLT
FROM
ADE.OBSN_E) A
INNER JOIN
(SELECT DISTINCT GR,GI,OE,LOE,OBE,CLD
FROM ADE.OBSN_E
GROUP BY
GR,GI,OE,LOE,OBE,CLD
HAVING COUNT(*)>1) B
ON
A.GR=B.GR AND
A.GI=B.GI AND
A.OE=B.OE AND
A.LOE=B.LOE AND
A.OBE=B.OBE AND
A.CLD=B.CLD
In the format mentioned by you :
SELECT A.* FROM
ADE.OBSN_E A
INNER JOIN
(
SELECT GR,GI,OE,LOE,OBE,CLD
FROM ADE.OBSN_E
GROUP BY GR,GI,OE,LOE,OBE,CLD
HAVING COUNT(*)>1
) B
ON
A.GR=B.GR AND
A.GI=B.GI AND
A.OE=B.OE AND
A.LOE=B.LOE AND
A.OBE=B.OBE AND
A.CLD=B.CLD