Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58
为防止分母中出现0,可用NULLIF与0做判断,若等于0,则返回NULL,任何数与NULL运算都为NULL,否则,返回原值。
declare @i int
set @i = 0
select(2/nullif(@i,0)