Please help me construct a query which can exclude records which meet a criteria.
I will try to describe the exact behavior I need, I want to exclude records which have fields with certain values.
------Create my table.
create table TABLE_NAME
(
CustomerID varchar(20),
COLOUR01 varchar(6),
COLOUR02 varchar(6),
COLOUR03 varchar(6))
---------insert values
Insert into TABLE_NAME (CustomerID,COLOUR01,COLOUR02,COLOUR03) values ('1','RED','GREEN','BLUE');
Insert into TABLE_NAME (CustomerID,COLOUR01,COLOUR02,COLOUR03) values ('2','RED','GREEN','BLUE');
Insert into TABLE_NAME (CustomerID,COLOUR01,COLOUR02,COLOUR03) values ('3','GREEN','GREEN','GREEN');
Insert into TABLE_NAME (CustomerID,COLOUR01,COLOUR02,COLOUR03) values ('4','ORANGE','GREEN','YELLOW');
Insert into TABLE_NAME (CustomerID,COLOUR01,COLOUR02,COLOUR03) values ('5','ORANGE','GREEN','YELLOW');
Insert into TABLE_NAME (CustomerID,COLOUR01,COLOUR02,COLOUR03) values ('6','ORANGE','GREEN','VIOLET');
Insert into TABLE_NAME (CustomerID,COLOUR01,COLOUR02,COLOUR03) values ('7','ORANGE','GREEN','VIOLET');
-----------Create query to exclude records which have COLOUR01=RED , COLOUR02=GREEN, and COLOUR03=BLUE
-----------I need to exclude the first two records, The logic needed is as follows if there is a record that has COLOUR01=RED , COLOUR02=GREEN, and COLOUR03=BLUE then exclude the record.
-----------Records 3 through 7 should be the results of the query.
Any suggestions will be greatly appreciated I am really breaking my head over this! TY