Your question title & question content .... not matching.
Regarding duplicate rows in table, you could use
DISTINCT
keyword. For example Employee table has tons of records with details such as employee id, name, designation, department, etc., Now, if you want to display list of designations, use the following query.
SELCT DISTINCT EMP_DESIGNATION FROM TABLE_EMP
IN
( &
NOT IN
) keywords are used to specify criteria in WHERE clause.
SELECT *
FROM TABLE_EMP
WHERE EMP_DESIGNATION IN ('Manager','Supervisor');
Above query will display all employees who're Manager or Supervisor.
NOT IN
works opposite way of
IN
like it'll display all employees who're
not Manager or Supervisor.