SQL Server转为Oracle问题

lyh434400 2004-09-15 03:55:11
表名为 aaa 表结构为 a b c d
在Sql Server 中语法为
declare @OK int
select @OK=count(*) from aaa where b='333'
if @ok>0 then
select 'Exist'
else
select 'Not Exist'
瑞在Oracle中如何进行此操作?

...全文
102 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
dinya2003 2004-09-15
  • 打赏
  • 举报
回复
create or replace function test return varchar2 as
OK number(8);
p_out varchar2(100);
begin
select count(*) into OK from aaa where b='333';
if OK>0 then
p_out:='Exist';
else
p_out:='Not Exist';
end if;
return p_out;
end;

17,380

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧