Link to home
Start Free TrialLog in
Avatar of VBdotnet2005
VBdotnet2005Flag for United States of America

asked on

sql query - not contain

I want to query and get only itemno that does not starts with '*' (like *100037-000), and RCD  not 'y'  . This column is char(25).  It still return * itemno in front.
     
     SELECT ITEMNO FROM table_1 WHERE rcd not like ('*%') or rcd is not null or rcd <> 'n'
     
     select distinct(rcd) from tables_1
     results : Y, N, NULL
Avatar of Aneesh
Aneesh
Flag of Canada image

you need a 'AND' instead of OR.
ASKER CERTIFIED SOLUTION
Avatar of Nem Schlecht
Nem Schlecht
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial