国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

sqlserver有用函數

2024-07-21 02:07:44
字體:
來源:轉載
供稿:網友
<!--#include file="./news/const.asp"-->isnull
使用指定的替換值替換 null。
語法
isnull ( check_expression , replacement_value )
參數
check_expression

將被檢查是否為 null的表達式。check_expression 可以是任何類型的。

replacement_value

在 check_expression 為 null時將返回的表達式。replacement_value 必須與 check_expresssion 具有相同的類型。
返回類型
返回與 check_expression 相同的類型。
注釋
如果 check_expression 不為 null,那么返回該表達式的值;否則返回 replacement_value。
示例a. 將 isnull 與 avg 一起使用
下面的示例查找所有書的平均價格,用值 $10.00 替換 titles 表的 price 列中的所有 null 條目。

use pubsgoselect avg(isnull(price, $10.00))from titlesgo

下面是結果集:

-------------------------- 14.24 (1 row(s) affected)
b. 使用 isnull
下面的示例為 titles 表中的所有書選擇書名、類型及價格。如果一個書名的價格是 null,那么在結果集中顯示的價格為 0.00。

use pubsgoselect substring(title, 1, 15) as title, type as type, isnull(price, 0.00) as pricefrom titlesgo

下面是結果集:

title type price --------------- ------------ -------------------------- the busy execut business 19.99 cooking with co business 11.95 you can combat business 2.99 straight talk a business 19.99 silicon valley mod_cook 19.99 the gourmet mic mod_cook 2.99 the psychology undecided 0.00 but is it user popular_comp 22.95 secrets of sili popular_comp 20.00 net etiquette popular_comp 0.00 computer phobic psychology 21.59 is anger the en psychology 10.95 life without fe psychology 7.00 prolonged data psychology 19.99 emotional secur psychology 7.99 onions, leeks, trad_cook 20.95 fifty years in trad_cook 11.95 sushi, anyone? trad_cook 14.99 (18 row(s) affected)
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 武穴市| 泰顺县| 广东省| 呈贡县| 同心县| 金门县| 敖汉旗| 彭州市| 温泉县| 平塘县| 南安市| 弥勒县| 繁峙县| 卓资县| 萝北县| 崇仁县| 临安市| 广宗县| 专栏| 万安县| 大安市| 昌江| 聊城市| 轮台县| 东阿县| 黄石市| 迁安市| 青州市| 谢通门县| 双城市| 准格尔旗| 黄山市| 天全县| 岳阳市| 綦江县| 泰顺县| 深圳市| 溆浦县| 阳谷县| 海安县| 杭州市|