select * from [dbo].[userinfo1]
where id = ‘2’
翻译:表示只会显示id为2的数据
2.like —— 粗略查找
select * from [dbo].[userinfo1]
where username like ‘%三’
这样出来的数据都是和三有关的,%可以理解为不限制,比如放在三前面,那么x三或者xx三等,都会搜索出来,
反之%在三后面,那么x三或者xx三就不会被搜索出来,出来的只会是三x或者三xx等等数据。
前后都有百分号,就说明不管开头结尾,只要有这个三,都会显示出来。
3.拓展——delete数据
delete [dbo].[userinfo1]
where username like ‘%雪%’
username里面就不会有雪了的数据了,只要有雪这个字的都不会存在。
SQL 入门学习记录—05-条件限制where * like
最新推荐文章于 2023-04-18 17:48:02 发布