用于测试空字段和空字段的Select语句 [英] A Select statement to test for null and empty fields

查看:94
本文介绍了用于测试空字段和空字段的Select语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的专家,





一个select语句,用于在表中的2个字段上测试null或0,并在中止过程它们存在



并提供不完整记录列表。







表::试用



字段:: idno名称提前月份
--- ---------------------------------
001 Pet 400 2
002 jane 5
003母鸡300 4
004朋友340
007 sam





请求。



1.不完整记录清单(即):



 idno名称提前月份
------------------------------------
002 jane 5
004朋友340
007 sam





2.如果有的话,中止的过程至少一个不完整





谢谢

解决方案

  SELECT  *  FROM 试用 WHERE  advance  IS   NULL   OR 个月 IS   NULL  


请尝试以下查询。

  SELECT  *  FROM 试用 WHERE  ISNULL(advance,'  0')<> '  0'  OR  ISNULL(月,'  0')< ;> '  0' 



Hope它有帮助


Dear Expert ,


A select statement to test for null or zero on 2 fields in a table and abort the process if they exist

and provide the list of incomplete record.



Table :: Trial

Fields :: idno name advance months
------------------------------------
          001  Pet  400     2
          002  jane         5
          003  hens 300     4
          004  pal  340
          007  sam



request.

1. The list of incomplete records (i.e.) :

idno name advance months
------------------------------------
002  jane         5
004  pal  340
007  sam



2. The process to abort if there is at least one incomple


Thanks

解决方案

SELECT * FROM Trial WHERE advance IS NULL OR months IS NULL


Please try the below query.

SELECT * FROM Trial WHERE ISNULL(advance,'0')<>'0' OR ISNULL(months,'0')<>'0'


Hope it helps


这篇关于用于测试空字段和空字段的Select语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆