Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "group" and "compute" clauses to "from" expression, aggregation and aggregate functions #6

Closed
julianhyde opened this issue Dec 3, 2019 · 1 comment

Comments

@julianhyde
Copy link
Collaborator

Add "group" and "compute" clauses to "from" expression. The effect is aggregation and aggregate functions. With "group" you cannot use "yield", only "compute".

For example, the expression

from e in emps
group (#deptno e) as deptno
  compute sum of (#id e) as sumId,
          count of e as count

is equivalent to the SQL query

SELECT e.deptno, SUM(e.id) AS sumId, COUNT(*) AS "count"
FROM emps
GROUP BY e.deptno
@julianhyde
Copy link
Collaborator Author

Fixed in f12d9cb.

There is a follow-up task to allow aggregate functions defined in the query. (The type inference algorithm needs to be made a bit more robust.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant