Arvindkumar
Arvindkumar

Reputation: 184

vertica db: Sum and groupby query while creating a projection

Is it possible to create a projection in vertica with the sum and group by sql query.

for eg,

CREATE PROJECTION X ...
  AS (SELECT sum(a) FROM Y group by a)...

It this is not possible, is there any alternative to achieve this in vertica ?

UPDATE: found out that group by is NOT allowed in projections.

Upvotes: 0

Views: 574

Answers (1)

geoffrobinson
geoffrobinson

Reputation: 1580

Just an explanation why it isn't allowed. The Select query in the projection is meant to establish the layout of the raw data. Aggregate functions would be better served as part of a view.

Upvotes: 1

Related Questions