select
case
when :app_user = "John.Doe" THEN select * from time_test
when :app_user !="John.Doe" then select * from time_test where :app_user
=:app_user
end
from time_test ;
此表本身是页面上的交互式报告。我希望每个人都能看到交互式报告,但我只希望John Doe可以看到整个表格。其他人只应该在桌子上看他们的记录。
“:app_user”是Oracle Apex的默认绑定变量。我还尝试过滤表中的字段。
select
case
when :app_user = "John.Doe" THEN select * from time_test
when :app_user !="John.Doe" then select * from time_test where **name**
=:app_user
end
from time_test ;
还有
select
case
when name = "John.Doe" THEN select * from time_test
when name !="John.Doe" then select * from time_test where :app_user
=:app_user
end
from time_test ;
我不能使用if语句,因为它需要以Select开头才能加载到页面上。
答案 0 :(得分:1)
简单过滤:
select *
from time_test
where col_name =:app_user OR :app_user = 'John.Doe';
答案 1 :(得分:1)