开发者

sql query to show all records except for certain records

开发者 https://www.devze.com 2022-12-12 23:39 出处:网络
i have an ms-access table TableA MSNPR 11- 13A 12Dead 14B 15C How can i write an sql query to remove records in \"-\" and \"Dead\" occurances in PR collumn. so that query result should be

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

精彩评论

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