开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜