我的例子: 数据准备: create table custinfo(custid integer,callingcnt integer); ,),(,),(,); 函数生成: CREATE OR REPLACE FUNCTION get_callingcnt(custid int) RETURNS TABLE ( custid int ,callingcnt int ) AS $$ BEGIN RETURN QUERY SELECT t.custid ,t.callingcnt FROM cus