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

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

求寫一個(gè)存儲(chǔ)過程··急用

求寫一個(gè)存儲(chǔ)過程··急用

慕的地10843 2018-11-11 13:12:01
有兩張表 tblkpi 和 student_dept.判斷tblkpi中sr1字段和ks2字段的值不為空或者大于0時(shí),修改student_dept中的classroom=1where classroom=0   并且tblkpi中的deptid=student_dept的id而且當(dāng)前系統(tǒng)時(shí)間的年份等于tblkpi中的year字段值,月份等于month字段值~~不知道我表達(dá)清楚了沒  ,急。。
查看完整描述

2 回答

?
holdtom

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

update  a set classroom=1
from student_dept a join tblkpi b on b.deptid=a.id
where (b.ks1 is not null or b.ks1>0) and (b.ks2 is not null or b.ks2>0)
and a.classroom=0 and b.year=YEAR(GETDATE()) and b.month=MONTH(GETDATE())
-- ms sql

查看完整回答
反對(duì) 回復(fù) 2018-11-15
?
神不在的星期二

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

declare @sr1 int ,@ks2 int
select @sr1=sr1 ,@ks2=ks2 from tblkpi nolock where 條件  --如果沒有條件的話,需要用到游標(biāo)
if(@sr1 is null or @ks2 > 0)
修改student_dept中的classroom=1where classroom=0   并且tblkpi中的deptid=student_dept的id 而且當(dāng)前系統(tǒng)時(shí)間的年份等于tblkpi中的year字段值,月份等于month字段值~~

查看完整回答
反對(duì) 回復(fù) 2018-11-15
  • 2 回答
  • 0 關(guān)注
  • 683 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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