Click here to Skip to main content
15,899,025 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Updated 20-Feb-13 23:00pm
v2
Comments
CHill60 21-Feb-13 11:04am    
Please post your query - it's better to fix the problem then turn off messages

1 solution

As you did not provide any code snippet I think your query could be like below
SQL
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

SQL
SELECT COUNT(CASE WHEN [uid] IS NULL THEN 0 ELSE 1 END) AS [new_count]
FROM   [Users]


Hope this will solve your issue.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900