i create function / stored procedure on POSTGRESQL with jsonb table, the problem is return only one row not all row.
CREATE OR REPLACE FUNCTION "public"."someprocedure"("begindate" date, "endate" date)
RETURNS TABLE("a" text, "b" text)
AS $BODY$
declare
BEGIN
RETURN QUERY
select data->>'a' as a,
data->>'b' as b
from table
where cast(timestamp as date) >= '2019-07-18'
and cast(timestamp as date) <> '2019-08-01' ;
END;
$BODY$
LANGUAGE plpgsql VOLATILE
COST 100
ROWS 1000;
expected:
table a | table b
data a | data b
reality:
someprocedure
a,b