数据库原理吉林大学随笔第13课时

3.4.3 group by 和 order by 字句的应用。

group by 子句是 根据列值分组
order by 子句是对查询结果进行排序 asc为升序 desc为降序。
group by后select 子句中间的的值在基本组中应该是唯一的

3.4.3 包含 union 的查询 (并操作)

参与并操作的目跟属性域应该相同。

3.5 SQL数据操纵语言

3.5.1 insert 语句(增加一个元组)

insert into

全字段插入要有所有字段的值,局部插入要在insert into 后加列名。
定义一个临时表的操作。
create table 表名 (字段 类型,字段类型,……);其次插入相关数据 insert into 表名 select 字段1,字段2,…… from 表名 where 条件。

猜你喜欢

转载自www.cnblogs.com/lanhai2020/p/12970169.html