columnExpr), each expression defining one column in the output table. The expressions can refer to the attributes or accumulators of the vertices and edges selected in the FROM clause of this query. A column can apply one of the
aggregatorfunctions (COUNT, SUM, AVG, MIN, MAX), so that the table aggregates the raw data into summary results. Each column can be given an alias for its heading (
INTO tableNameto store the results in a table.
tableNamecan be any identifier that has not been used in the query before.
DISTINCThas the same meaning as it does in SQL: values that appear more than once in the raw data should only be used once. It can be used either individually for aggregated columns (e.g., count how many unique values there are) or collectively so that there are no repeated rows in the table.
socialNet, which has vertex types
post, and edge type
likedfor when someone likes a post, use a query to retrieve timestamps of all likes, the subject of the posts being liked, and the primary IDs of the people who liked the posts.
groupExprare grouped together. If there is a second
groupExpr, then this is used to subdivide each group into subgroups, and so on through the list of
groupExprfrom left to right.
groupExprmay be a vertex or edge alias from the FROM clause, or an attribute of a vertex or edge alias. Furthermore, each
groupExprmust either be the same as or the basis of a SELECT
columnExpr. In the SELECT clause, any columns which are not associated with a groupExpr must be be aggregated (with COUNT, SUM, AVG, MIN or MAX) and must be at the end of the list of columns. For example, in the workNet graph, if we have this FROM clause:
FROM person:p -(worksFor:w)- company:cand if we want columns for company's country, whether working full time or not, and employees, with no grouping we could have