摘要:
测试 阅读全文
posted @ 2023-01-23 15:39
RILI520
阅读(441)
评论(0)
推荐(0)
摘要:
SQL99新特性 SQL99在SQL92的基础上提供了一些特殊语法 1.自然连接 可以将 自然连接 理解为SQL92中的等值连接 natual join 用来表示自然连接 natual join 会自动查询两张表中,所有相同的字段,然后进行等值连接 在SQL92标准中 select employ 阅读全文
posted @ 2023-01-23 15:01
RILI520
阅读(40)
评论(0)
推荐(0)
摘要:
多表查询可以分为 什么是join join具有连接的作用,即当两个以上的表有关系时,需要用join来连接这些相关的表,来处理或分析数据。 join的作用:连接 这里有两张表,使用join将两个表连接,不会改变原来的表 rili join ret 会生成一个新表 select *from ri 阅读全文
posted @ 2023-01-23 15:01
RILI520
阅读(34)
评论(0)
推荐(0)
摘要:
多表查询可以分为 什么是join join具有连接的作用,即当两个以上的表有关系时,需要用join来连接这些相关的表,来处理或分析数据。 join的作用:连接 这里有两张表,使用join将两个表连接,不会改变原来的表 rili join ret 会生成一个新表 select *from ri 阅读全文
posted @ 2023-01-23 15:01
RILI520
阅读(36)
评论(0)
推荐(0)
摘要:
角度1:等值连接 与 非等值连接 角度2:自连接 与 非自连接 角度3:内连接 与 外连接 等值连接(使用=号连接) 非等值连接(不使用=号连接(如< ,>,<=,>=,!=)) select e.last_name,e.salary,j.grade_level from employees e 阅读全文
posted @ 2023-01-23 15:01
RILI520
阅读(40)
评论(0)
推荐(0)
摘要:
having的使用 作用:用来过滤数据 练习:查询部门10,20,30,40,这4个部门中最高工资比10000高的部门信息 select department_id,max(salary) from employees group by department_id having department 阅读全文
posted @ 2023-01-23 15:01
RILI520
阅读(245)
评论(0)
推荐(0)
摘要:
聚合函数(多行处理函数) 当行处理函数:接受一个参数,返回一个结果 多行处理函数:接受多个参数,返回一个结果 什么是聚集函数 聚集函数作用于一组数据,并对一组数据返回一个值 常用聚合函数 sum( ),avg( ),max( ),min( ) 以上所有函数都会忽略null count( ) 计算指定 阅读全文
posted @ 2023-01-23 15:01
RILI520
阅读(78)
评论(0)
推荐(0)
摘要:
group by 的使用 select job_id,avg(salary) from employees group by job_id; 查询各个department_id,job_id的平均工资 select job_id,department_id,avg(salary) from em 阅读全文
posted @ 2023-01-23 15:01
RILI520
阅读(195)
评论(0)
推荐(0)
摘要:
列的别名 as 要替换的名称 as:全称:alias(别名),可以省略 列的别名:可以使用一对 “ ” 引起来,不要使用 ‘ ’ select employee_id usename ,last_name as principle,salary "sal" from employees; 阅读全文
posted @ 2023-01-23 15:01
RILI520
阅读(117)
评论(0)
推荐(0)
摘要:
逻辑运算符 not 或! 逻辑非 and 或 && 逻辑与 and的优先级高于 or or 或 || 逻辑或 xop 逻辑异或 select a xop b from dual; 不同为真,相同为假 位运算 & 按位与 | 按位或 ^ 按位异或 ~ 按位取反 阅读全文
posted @ 2023-01-23 15:01
RILI520
阅读(27)
评论(0)
推荐(0)