PostgreSQL 存储过程
我有两个独立的 PostgreSQL 计数查询,我想将它们输出为一份合并报告。我对此做了一些研究,发现它可以通过存储过程来完成,但我不确定应该如何去做(我对 Postgres 编程相当陌生)。
两个查询都返回计数。
任何对此的见解将不胜感激!
I have two separate PostgreSQL count queries that I would like to output as one combined report. I have done a little bit of research into this and found that it could be done through a stored procedure, but I am not sure how I should go about doing this (I'm fairly new to Postgres programming).
Both of the queries are returning counts.
Any insight into this would be much appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您甚至不需要为此存储过程。您可以只进行一个大查询:
You don't even need a stored procedure for this. You can just make one big query:
我不相信 PostgreSQL 有存储过程,只有函数。但是,您可以使用函数来完成您正在谈论的事情。
I don't believe PostgreSQL has stored procedures, only functions. However, you could do what you're talking about with a FUNCTION.