如何在执行View查询时关闭警告消息 [英] How to Off Warnings Message in Execute the View Query
本文介绍了如何在执行View查询时关闭警告消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我执行View Query但是给出警告:Null值被聚合或其他SET操作消除。但是没有受影响的数据所以如何停止警告信息
在视图中请告诉我任何功能。我正在使用Set_Ansi_warning off但这不起作用,因为这是视图。
thans&Regards
raju
Hi,
I am Execute The View Query But Give "Warning: Null value is eliminated by an aggregate or other SET operation." But not affected data so how to stop warning messages
in view Please tell me the any functions. I am using "Set_Ansi_warning off" But this not worked because this is view.
thans & Regards
raju
推荐答案
因为你没有提供任何代码片段我认为您的查询可能如下所示
As you did not provide any code snippet I think your query could be like below
SELECT COUNT([uid]) AS [new_count]
FROM [Users]
如果表的任何列包含空值,则上述查询将产生警告。最好写下面的查询
This above query will produce the warning if any column of the table contains null value. Better to write the query like below
SELECT COUNT(CASE WHEN [uid] IS NULL THEN 0 ELSE 1 END) AS [new_count]
FROM [Users]
希望这能解决您的问题。
Hope this will solve your issue.
这篇关于如何在执行View查询时关闭警告消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文