The query does not seem to make a lot of sense, and from what I understood, it has really basic SQL shortcomings, that's why I voted you down. See the explanation below; try to follow the suggestions; and finally edit your question once you've tried something along the lines below.
Looks like going back to the documentation of (any, not just Vertica) SQL could help you a lot:
- The
DISTINCT
keyword is only "legal" directly after SELECT
or in COUNT(DISTINCT <expression>
)
- In a
GROUP BY
query, the columns in the SELECT list are either columns that will be repeated in the GROUP BY
clause, or they are aggregate functions - like your MAX() and your COUNT() . GROUP BY (msisdn)
when msisdn
is not in the SELECT list won't help at all.
Hope these hints help ---
Good luck
Marco the Sane