sql exclude duplicates from select code example Example: sql exclude duplicates and find even id SELECT DISTINCT city FROM tablename WHERE id % 2 = 0