Voila le code :
CREATE OR REPLACE FUNCTION interville () RETURNS SETOF text[] AS'
BEGIN
select location.location as city, count(locate.nmovie) as movies_count
from location, locate
where locate.nlocation = location.nlocation
group by location.location
order by movies_count desc;
END;'
LANGUAGE plpgsql;
select * from interville ()
Voila le probleme:
ERROR: SELECT query has no destination for result data
HINT: If you want to discard the results, use PERFORM instead.
CONTEXT: PL/pgSQL function "interville" line 2 at SQL statement
In statement:
select * from interville ()
Je ne comprend pas.
Please help me.
Je tiens a preciser que le type de retour m est impose.
Partager