Home > Database > Mysql Tutorial > body text

mssql sql删除null记录方法

WBOY
Release: 2016-06-07 17:48:34
Original
1717 people have browsed it

本文章简单的介绍一下在数据库使用时常碰到的关于sql null数据的处理,我们利用了二种方法来处理null的数据,有需要的朋友可以参考一下。

--现在需要一个简单的查询来剔除掉这些为null的记录行。
--假设表名为 emplyees
--方法1.
---先把数据导入到
---其次:

 代码如下 复制代码
* from sys.columns
where object_id =(select object_id from sys.objects where name='EMPLYEEs')

---方法2
---使用数据库提供的函数

 代码如下 复制代码
exec sp_columns 'Employees'
delete from Employees where coalesce(status,tel,gwei,ADDRESS1,address2,nwei) is null
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template