018条件查询之或者or
or表示或者,还有另一种写法:||
案例:找出工作岗位是MANAGER和SALESMAN的员工姓名、工作岗位
注意字符串一定要带单引号
select ename, job from emp where job='manager' or job='salesman';

任务:查询20和30部门的员工信息。
select * from emp where deptno=20 or deptno=30;

019条件查询之and和or优先级
案例:找出薪资小于1500,并且部门编号是20或30的员工姓名、薪资、部门编号。
select ename, sal, deptno from emp where sal<1500 and (deptno=20 or deptno=30);

between…and…等同于 >= and <=
select ename, sal from emp where sal between 1600 and 3000;

在使用的时候一定要注意:左小右大。
select ename from emp where ename between 'g' and 'z';

select * from emp where HIREDATE between '1981-05-01' and '1982-01-23';

is null、is not null
select ename, sal, comm from emp where comm is null;

in、not in
select ename, sal, job from emp where job='manager'or job='salesman';
select ename, sal, job from emp where job in ('manager', 'salesman');

in、not in 与 NULL
select * from emp where comm in(NULL, 300);
等价于
select * from emp where comm = NULL or comm = 300;
其中NULL不能用等号=进行判断,所以comm = NULL结果是false,然而中间使用的是or,所以comm = NULL被忽略了。所以查询结果就以上一条数据。
通过以上的测试得知:in是自动忽略NULL的。

select * from emp where comm not in(NULL, 300);
等价于
select * from emp where comm <> NULL and comm <> 300;
其中NULL的判断不能使用<>,所以comm <> NULL结果是false,由于后面是and,and表示并且,comm <> NULL已经是false了,所以and右边的就没必要运算了,comm <> NULL and comm <> 300的整体运算结果就是false。所以查询不到任何数据。
通过以上测试得知,not in是不会自动忽略NULL的,所以在使用not in的时候一定要提前过滤掉NULL。

024条件查询之模糊查询
模糊查询又被称为模糊匹配,在实际开发中使用较多,比如:查询公司中所有姓张的,查询岗位中带有经理两个字的职位等等,这些都需要使用模糊查询。
模糊查询的语法格式如下:
select .. from .. where 字段 like '通配符表达式';
在模糊查询中,通配符主要包括两个:一个是%,一个是下划线_。其中%代表任意多个字符。下划线_代表任意一个字符。
案例1:查询员工名字以’S’开始的员工姓名
案例2:查询员工名字以’T’结尾的员工姓名
select ENAME from emp where ENAME like 'S%';
select ENAME from emp where ENAME like '%T';
案例3:查询员工名字中含有’O’的员工姓名
select ename from emp where ename like '%O%';

案例4:查询员工名字中第二个字母是’A’的员工姓名
select ename from emp where ename like '_A%';

案例5:查询学员名字中含有下划线的。

select name from student where name like '%\_%';





![[AVL数四种旋转详细图解]](https://img-blog.csdnimg.cn/direct/9ddd10d3b3284bc7831103b597e73014.png)










![YOLOv8_obb训练流程-原理解析[旋转目标检测理论篇]](https://img-blog.csdnimg.cn/direct/73b7ddb1c88746d7b00c7b7ed5d81624.png)



