SQL Server基础

1 delete from table清空表中的数据, 还可以加where删除条件内的数据.

2 like 与通配符搭配使用, _ 下划线代表一个字符; % 代表0个或任意多个字符.

3 null 前面需要加is 例如 select * from stu where name is null

4 常用函数: abs()求绝对值; ceiling()舍入到最大整数; floor()舍入到最小整数; round()四舍五入; len()串长度; lower(); upper(); ltrim(); rtrim(); substring(); getdate(); dateadd(); datediff(); datepart(); cast(); convert(); right(); 

  空值处理函数isnull() 

5 case 函数,相当于switch case, case ... when ... then ...   else ... end; 有时case后面不跟东西,直接跟when

 

posted @ 2021-06-09 22:36  Captain_Amazing  阅读(44)  评论(0编辑  收藏  举报