第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

關(guān)于SQL 簡(jiǎn)單的語(yǔ)法問(wèn)題,isnull,內(nèi)容太長(zhǎng),具體的情況如下所示

關(guān)于SQL 簡(jiǎn)單的語(yǔ)法問(wèn)題,isnull,內(nèi)容太長(zhǎng),具體的情況如下所示

慕慕森 2021-05-30 09:06:08
簡(jiǎn)單的sql語(yǔ)句,由于自己水平一般,不知道錯(cuò)在哪里...忘熟悉語(yǔ)句的人指導(dǎo)一二,謝謝!select new_name as 年度,count(new_name) as 總份數(shù),round(sum(case new_q01 when '0' then filterednew_survey.new_q01when filterednew_survey.new_q01 is null then '0'else(filterednew_survey.new_q01-1.00)end),2) as 產(chǎn)品的銷(xiāo)售價(jià)格打分from filterednew_surveygroup by new_name為什么這句提示關(guān)鍵字 'is' 附近有語(yǔ)法錯(cuò)誤???selectnew_name as year,count(new_name) as quantity,round(sum(isnull(new_q01,1.00)-1.00)/sum(casewhen new_q01 is null then 0else 1 end ),2) as 產(chǎn)品的銷(xiāo)售價(jià)格打分from filterednew_surveygroup by new_name這句沒(méi)有問(wèn)題.selectnew_name as year,count(new_name) as quantity,round(sum(isnull(new_q01,1.00)-1.00)/sum(casewhen new_q01 is null then 0else 1 end ),2) as 產(chǎn)品的銷(xiāo)售價(jià)格打分from filterednew_surveygroup by new_name這句也沒(méi)有問(wèn)題請(qǐng)各位指導(dǎo)下~~~經(jīng)過(guò)幾位的幫忙,我自己修改了一下,改成select new_name as 年度,count(new_name) as 總份數(shù),round(sum(case new_q01 when '0' then filterednew_survey.new_q01else (isnull(filterednew_survey.new_q01,1.00)-1.00)end),2) as 產(chǎn)品的銷(xiāo)售價(jià)格打分from filterednew_surveygroup by new_name也重新理解了下isnull但是有還是有點(diǎn)小小的不明白selectnew_name as year,count(new_name) as quantity,round(sum(isnull(new_q01,1.00)-1.00)/sum(casewhen new_q01 is null then 0else 1 end ),2) as 產(chǎn)品的銷(xiāo)售價(jià)格打分from filterednew_surveygroup by new_name為什么這句的也是is null then 0就可以呢?
查看完整描述

2 回答

?
慕少森

TA貢獻(xiàn)2019條經(jīng)驗(yàn) 獲得超9個(gè)贊

select new_name as 年度,
count(new_name) as 總份數(shù),

round(sum(case isnull(new_q01,0) when '0' then '0'
else(filterednew_survey.new_q01-1.00) end),2) as 產(chǎn)品的銷(xiāo)售價(jià)格打分

from filterednew_survey
group by new_name

改成這個(gè)試一下

-------------------------------
when new_q01 is null then 0
else 1 end
這個(gè)是不行的 你會(huì)發(fā)現(xiàn) 不管他是不是null 他返回的都是1

查看完整回答
反對(duì) 回復(fù) 2021-06-07
?
拉風(fēng)的咖菲貓

TA貢獻(xiàn)1995條經(jīng)驗(yàn) 獲得超2個(gè)贊

ISNULL使用指定的替換值替換 NULL。
語(yǔ)法
ISNULL ( check_expression , replacement_value )

IS NULL 是兩個(gè)關(guān)鍵字,在一起用是判斷指定的內(nèi)容是否是 null
兩個(gè)似乎沒(méi)有什么可比性

查看完整回答
反對(duì) 回復(fù) 2021-06-07
  • 2 回答
  • 0 關(guān)注
  • 472 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)