You are on page 1of 1

CREATE OR REPLACE FUNCTION clientes_nomes() RETURNS text AS $$ declare x text; r record; c int; begin x:=''; c:= 0; for r in select

* from cliente order by cdcli loop IF (c > 0) THEN x:=x ' - '; END IF; x:= x r.nmcli ' '; c:=(c + 1); end loop; return x; end; $$ LANGUAGE 'plpgsql'; select clientes_nomes();

You might also like