Teradata Database Message 3504 - 3504 - Analytics Database - Teradata Vantage

Teradata® VantageCloud Lake - Analytics Database Messages

Edition
Lake
Product
Analytics Database
Teradata Vantage
Published
October 2022
Language
English (United States)
Last Update
2024-02-26
dita:mapPath
tzr1629746512312.ditamap
dita:ditavalPath
ft:empty
dita:id
vza1585613049811
lifecycle
latest
Product Category
Teradata® Vantage™
Message
Selected non-aggregate values must be part of the associated group.
Explanation
This error occurs when an aggregate query includes a non-aggregate expression in the SELECT list, WHERE clause, ORDER BY clause, HAVING clause or WITH list that is not also exactly specified in the corresponding GROUP BY or WITH...BY clause. Note that we also return this error when ORDER BY and WITH clauses contain aggregates but the query does not.
Generated By
OPT modules.
For Whom
End User.
Notes
For example, it is not legal to: SELECT State GROUP BY ZipCode; . In order for the request to be legal, it may be changed to: SELECT State GROUP BY State, ZipCode; . It is also not legal to: SELECT StateNo WITH SUM(StateNo) ORDER BY SUM(StateNo) ; A legal request is: SELECT SUM(StateNo) WITH SUM(StateNo) ORDER BY SUM(StateNo) ;
Remedy
Correct the request and resubmit it.