Hi Mnylin,
Sorry for not being clear.For eg: We have a table Tab_a
Col1 Col2 Col3
1 Ashok Y
1 Ashok N
2 Mnylin Y
The output for the below query will be:
SELECT *
FROM Tab_a
QUALIFY ROW_NUMBER() OVER (partition by col1,col2 order by 1) = 1;
Col1 Col2 Col3
1 Ashok Y
2 Mnylin Y
The output for the query which you gave will be:
SELECT * FROM Tab_A WHERE (col1, col2) IN (SELECT Col1, Col2 FROM TAB_A GROUP BY 1,2 HAVING COUNT(*) = 1);
Col1 Col2 Col3
2 Mnylin Y
Here I dont want to exclude duplicates.I want to select a row even if we have duplicates and exclude the other duplicate at key level(col1/col2).I want to fetch the result which is very similar to query1.I hope this is clear.