Please explain how you can assign a query to a variable by analogy as in mssql
@ result = Select * from dual where a1 = a2; Real example
CREATE OR REPLACE FUNCTION table_test () RETURNS varchar(1) AS $BODY$ DECLARE outinfo varchar(1); test text; BEGIN test = select count(*) from table; if test>0 THEN outinfo := 'y'; else outinfo := 'n'; END if; return outinfo; end; $BODY$ LANGUAGE plpgsql VOLATILE
select X from DUAL ... into Result- Mike