展开全部
BEGIN
IF EXISTS(select 1 from rw_yzs_Static where pagetype =i_pagetype and catalogCode = i_catalogCode and serviceCode = i_serviceCode and serviceName = i_serviceName) THEN
update rw_yzs_Static set serviceCode=i_serviceCode,serviceName=i_serviceName,zgbb =i_zgbb,sxmc =i_sxmc,cnqx =i_cnqx,sfbz =i_sfbz,dz =i_dz,bldx = i_bldx,bltj =i_bltj,sxcl =i_sxcl,ckbllc =i_ckbllc,wsbllc = i_wsbllc,blsx =i_blsx,blyj = i_blyj,bz =i_bz,updatetime = NOW()
where pagetype =i_pagetype and catalogCode = i_catalogCode and serviceCode = i_serviceCode and serviceName = i_serviceName;
ELSE
INSERT INTO rw_yzs_Static (pagetype,divisioncode,divisionname,catalogCode,catalogName,serviceCode,serviceName,orgGroup,zgbb,sxmc,cnqx,sfbz,dz,bldx,bltj,sxcl,ckbllc,wsbllc,blsx,blyj,bz,updatetime)
VALUES(i_pagetype,i_divisioncode,i_divisionname,i_catalogCode,i_catalogName,i_serviceCode,i_serviceName,i_orgGroup,i_zgbb,i_sxmc,i_cnqx,i_sfbz,i_dz,i_bldx,i_bltj,i_sxcl,i_ckbllc,i_wsbllc,i_blsx,i_blyj,i_bz,now());
END IF;
END
例子与回答无关:
这里应该用case when then 这类的吧
这里给个思路,具32313133353236313431303231363533e4b893e5b19e31333363373763体用法还是自己去百度吧。应该太多了这种教学。
select case 学分 when <60 then xf=0 from xscj where 学号=xh and 课程名称 =kcmc
你里你应该新增一个变量来记录成绩的值 才能对此进行IF判断