VBdotnet2005
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
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
you need a 'AND' instead of OR.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.