怎么用Oracle写if exist
ifexists(selectrtbgdtfromznjs_prjrettabwhereprjno='1906717502707'andtstno='1')selectd...
if exists(select rtbgdt from znjs_prjrettab where prjno = '1906717502707' and tstno = '1') select distinct rtbgdt,rtbgdt from znjs_prjrettab where prjno = '1906717502707' and tstno = '1' else select null,'无'
这个是我用SQLserver写的,怎么用Oracle写呢 展开
这个是我用SQLserver写的,怎么用Oracle写呢 展开
2个回答
展开全部
declare
v_cnt number;
begin
select count(*) into v_cnt from znjs_prjrettab where prjno = '1906717502707' and tstno = '1';
if v_cnt = 0 then
dbms_output.put_line('有记录');
else
dbms_output.put_line('无记录');
end if;
end;
v_cnt number;
begin
select count(*) into v_cnt from znjs_prjrettab where prjno = '1906717502707' and tstno = '1';
if v_cnt = 0 then
dbms_output.put_line('有记录');
else
dbms_output.put_line('无记录');
end if;
end;
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询