I'm trying to query a table so that if
table1:
x y z
gg 1 E
ll 1 E
ff 2 NA
ee 2 E
rr 3 E
ww 3 NA
The query returns only those rows with 1 and 2 in column y that do not have an "NA" string in column z like this:
x y z
gg 1 E
ll 1 E
ee 2 E
I tried doing something like:
SELECT * FROM table1 WHERE (((y = 1) OR (y = 2)) AND (z <> "NA"));
I also tried:
SELECT * FROM table1 WHERE y IN (1,2) AND (z <> "NA");
None of these worked.
Try this SQL query. I think your z column may contain extra spaces.
SELECT * FROM Table1 AS T
WHERE T.y IN(1,2)
AND T.z NOT LIKE '%NA%'
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments