Oracle不是pl/sql
我想做一个案例陈述后再做一个选择 i、 e 无法使用PL/SQL 任何帮助都将不胜感激我想你需要这个:Oracle不是pl/sql,sql,oracle,Sql,Oracle,我想做一个案例陈述后再做一个选择 i、 e 无法使用PL/SQL 任何帮助都将不胜感激我想你需要这个: select * from inside_sales where x = 'equipment' union all select * from outside_sales where x <> 'equipment'; 注意:如果x可以为NULL,则第二个条件会稍微复杂一些。类似这样的情况。但是如何处理检索到的数据呢 create function sales_report (
select * from inside_sales where x = 'equipment'
union all
select * from outside_sales where x <> 'equipment';
注意:如果x可以为NULL,则第二个条件会稍微复杂一些。类似这样的情况。但是如何处理检索到的数据呢
create function sales_report (is_x IN varchar2)
return // what to return?
is
row_i_s inside_sales%rowtype;
row_o_s ouside_sales%rowtype;
begin
case is_x
when 'equipment'
then
select *
into row_i_s
from inside_sales;
else
select *
into row_o_s
from outside_sales;
end;
return // what to return?
end;
如果你能展示一些示例数据和你想要的结果,那会有帮助的。非常感谢,我可以让报告作者写一些我没有理解的东西。请举例说明。
create function sales_report (is_x IN varchar2)
return // what to return?
is
row_i_s inside_sales%rowtype;
row_o_s ouside_sales%rowtype;
begin
case is_x
when 'equipment'
then
select *
into row_i_s
from inside_sales;
else
select *
into row_o_s
from outside_sales;
end;
return // what to return?
end;