sql query to show all records except for certain records
i have an ms-access table
TableA
MSN PR
11 -
13 A
12 Dead
14 B
15 C
How can i write an sql query to remove records in "-" and "Dead" occurances in PR collumn. so that query result should be
MSN PR
13 A
14 B
15 C
any开发者_如何学JAVA help appreciated
To exclude the rows from a selection:
select *
from TableA
where PR not in ('-','Dead')
Or to permanently remove them:
delete
from TableA
where PR not in ('-','Dead')
select msn, pr from tableA where pr not in ('_', 'Dead')
The answer essentially is 'create a search condition by adding a WHERE
clause to your query' i.e. you clearly know next to nothing about SQL so an online tutorial aimed a beginners would be more appropriate than a Q&A site.
精彩评论