18.9.4 下午 第32天上课 数据库 上一天也是数据库

=================================================================================================

=================================================================================================

练习一天代码 语法

DQL:
select distinct 列名1,列名2... from 表名 where 过滤条件 order by 列名(asc)desc
过滤条件中 列名 like % 放在where字句最后面
2.where子句
1.等值条件 非等值条件
2.模糊查询 _ % 
3.is null
4.and/or优先级
函数
字符函数 lower() upper() initcap() replace substr
数值函数 ceil floor round trunc 注意传参为负值的情况
日期函数 months_between() next_day() last_day() add_month()
通用函数 nvl() 替换null值的情况 decode() 等同于switch case用法 替换对等的信息值
转化函数 to_date() to_number to_char()注意:对于的转换格式
统计函数 min() max() avg() sum() count():忽略值为null的记录
分组函数 group by 列名 对某一列进行分组 对分组前进行过滤 使用where子句
对分组后进行过滤则使用having 列名
单表查询语句的顺序 select -->from--->where-->group by -->having-->order by 

DML(insert ,update ,delete)
 

猜你喜欢

转载自blog.csdn.net/qq_42770040/article/details/82382546