Kindly i need solution for a below error when i was run the the function.



ERROR: query has no destination for result data
HINT: If you want to discard the results of a SELECT, use PERFORM instead.
CONTEXT: PL/pgSQL function "example" line 8 at SQL statement

********** Error **********

ERROR: query has no destination for result data
SQL state: 42601
Hint: If you want to discard the results of a SELECT, use PERFORM instead.
Context: PL/pgSQL function "example" line 8 at SQL statement


--------------------------------------------------------------

create or replace function example(id int)
returns setof record as
$s$
begin
if id = 0 then

select * from sm;

else
select * from asd ;

end if;
end;
$s$
language 'plpgsql';

select example(1);