CREATE VIEW grafico AS SELECT AVG(realizacao) , AVG(estima), AVG(fisiologica),AVG(seguranca),AVG(social) FROM necessidade;
I'm trying to create a view that brings the average of five columns of the required table, but I can not create this view with the above query.
Postgres says that I'm using the AVG function more than once.
Follow my table need:
CREATE TABLE necessidade
(
id serial NOT NULL,
realizacao integer,
estima integer,
fisioologica integer,
seguranca integer,
social integer,
PRIMARY KEY (id)
)