CREATE OR REPLACE FUNCTION TEST() RETURNS TABLE(a INT,b BOOLEAN) AS $$ BEGIN RETURN QUERY SELECT 1,true; END; $$ LANGUAGE plpgsql; SELECT * FROM TEST();
Reference:
http://www.postgresqltutorial.com/plpgsql-function-returns-a-table/
http://www.postgresql.org/docs/current/interactive/plpgsql-control-structures.html#PLPGSQL-STATEMENTS-RETURNING
http://www.postgresql.org/docs/9.3/static/sql-createfunction.html
https://technet.microsoft.com/en-us/library/ms191165.aspx
沒有留言:
張貼留言