CREATE LANGUAGE plpgsql
CREATE or REPLACE function getDatirenshu(w_wjID int)
RETURNS INTEGER
as
'
DECLARE
datiRenshu INTEGER;
BEGIN
select count(id) into datiRenshu
from rfwenjuan_yuanshijieguo
where wenjuanItem_id=w_wjID;
return datiRenshu;
end;' LANGUAGE 'plpgsql';
调用
select getdatirenshu(1);
时间: 2024-12-28 16:08:55