day03
操作符以及SQL函数
–执行数值计算
SELECT stu_name,salary,salary+1000 FROM STUINFO ;
–比较操作符
select * from STUINFO where salary between 1000 and 2000;
–逻辑操作符
select * from STUINFO where NOT salary <> 2000;
–连接操作符
select(‘员工号为’||stu_id||’,姓名为’||stu_name||‘的工资为’||salary)from STUINFO;
–集合操作符
select * from stuinfo where salary>=1000
intersect
select * from stuinfo where age > =26;
–intersect返回两个查询的公共行;
–union:返回两个查询的不重复的所有行;这里面可以是一个表中的数据;
–minus:返回从第一个查询的结果中排除第二个查询中出现的行;(在第一个的结果中查找不满足第二个的)
–优先级:算术>连接>比较>not逻辑>and逻辑>or逻辑操作符
其他单行函数
3