Postgres-如果满足条件,请从表中选择
我是PSQL世界的新手。主要是PLPGSQL
语言。 我正在尝试执行以下查询;但是,我一直收到以下例外:
查询没有结果数据的目的地
do $$
begin
if 1 > 2 then
select * from mx.transaction_category_type;
else
select * from mx.transaction;
end if;
end $$;
查询如果我使用加薪通知'2大于1'
而不是选择
,则
。我想做的甚至可能做的事情吗?
I'm new to the PSQL world. Mainly the plpgsql
language.
I'm trying to execute the query below; however, I keep receiving the following exception:
query has no destination for result data
do $
begin
if 1 > 2 then
select * from mx.transaction_category_type;
else
select * from mx.transaction;
end if;
end $;
If I use raise notice '2 is greater than 1'
instead of select
, this query executes fine.
Is what I'm trying to do even possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论