I have a test_table with the following data :
[code]
select * from test_table;
[/code]
Number | Name |
1 | AA |
1 | DD |
2 | |
3 | WW |
4 | EE |
5 | YY |
5 | TT |
6 | UU |
8 | SS |
i want to add where condition to my select to remove all duplicate rows and the result would be :
Number | Name |
2 | |
3 | WW |
4 | EE |
6 | UU |
8 | SS |
thanks in advance.
you can use :
[code]
SELECT *
FROM test_table
WHERE number_col NOT IN (SELECT number_col
FROM test_table
GROUP BY number_col
HAVING count (*) > 1)
[/code]