必须会的SQL语句(五) NULL数据处理和类型转换
作者:mdxy-dxy 时间:2024-01-18 23:40:51
1.Null数据的处理
1)检索出null值
select * from 表 where xx is null
2)null值替换
select
name,
isnull ( cast (字段 as varchar(20)) , '空')
from 表名
2.数据类型转换
1)Cast
--'101'可以用表中字段来替换
select cast('101' as varchar(20))
2)Convert
select convert(varchar(20),100)
标签:NULL数据处理,类型转换
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
JQuery的Ajax请求实现局部刷新的简单实例
2024-05-02 17:05:17
![](https://img.aspxhome.com/file/2023/8/129998_0s.png)
Django实现前台上传并显示图片功能
2022-04-05 19:49:39
Python异常处理操作实例详解
2023-05-06 11:31:05
python lxml中etree的简单应用
2022-01-11 09:34:15
![](https://img.aspxhome.com/file/2023/3/133763_0s.png)
css3弹性盒模型
2010-05-10 20:47:00
![](https://img.aspxhome.com/file/UploadPic/20105/10/01-33s.jpg)
超全面的JavaScript开发规范(推荐)
2024-04-18 10:52:37
![](https://img.aspxhome.com/file/2023/7/136477_0s.jpg)
JavaScript 设计模式 富有表现力的Javascript(一)
2023-08-25 07:42:15
基于Django用户认证系统详解
2023-04-13 15:35:13
基于PyQt5实现一个无线网连接器
2023-01-14 19:15:19
SQL Server 作业的备份(备份作业非备份数据库)
2012-07-11 15:58:49
django 使用全局搜索功能的实例详解
2023-01-26 05:56:56
MySQL数据库的多种连接方式及工具
2024-01-13 10:37:14
![](https://img.aspxhome.com/file/2023/8/126258_0s.jpg)
关于MySQL中隐藏空间的问题
2009-07-30 08:15:00
python3爬虫怎样构建请求header
2023-04-17 19:01:45
![](https://img.aspxhome.com/file/2023/7/68857_0s.png)
Mysql精粹系列(精粹)
2024-01-21 02:27:05
D3.js实现拓扑图的示例代码
2024-05-09 10:20:06
![](https://img.aspxhome.com/file/2023/9/126869_0s.png)
Go的固定时长定时器和周期性时长定时器
2023-06-27 12:44:23
几款Python编译器比较与推荐(小结)
2022-07-21 01:31:56
![](https://img.aspxhome.com/file/2023/1/85121_0s.png)
dl,dt,dd标签 VS 传统table实现数据列表
2009-08-02 20:45:00
![](https://img.aspxhome.com/file/UploadPic/20098/2/dl-vs-table-82s.png)
用sqlalchemy构建Django连接池的实例
2021-09-22 20:20:30