SQL之总结(三)
1.怎么在where指定多个值得问题?
select * from tb_article where article_id in(10008,10009)
结果如下:
如果是字符串的话:
select * from tb_article where name in ('沙利','魏凡')
2.between...and...会取介于两者之间的数据 可以是数字 日期 和字母
如需使用上面的例子显示范围之外的人,请使用 NOT 操作符
select * from tb_article where article_id not between 10008 and 10009
select * from tb_article where article_id between 10008 and 10009