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 distinct keyword as shorthand for group with all fields and no aggregate functions #231

Closed
julianhyde opened this issue Dec 2, 2024 · 0 comments

Comments

@julianhyde
Copy link
Collaborator

Add distinct keyword as shorthand for group with all fields and no aggregate functions.

For example, the following are equivalent:

(*) Using `distinct`
from e in scott.emp
  yield {e.job, e.deptno}
  distinct;

(*) Using `group` with no aggregate functions
from e in scott.emp
  yield {e.job, e.deptno}
  group job, deptno;

(This is analogous to how, in SQL, SELECT DISTINCT job, deptno FROM emp is equivalent to SELECT job, deptno FROM emp GROUP BY job, deptno. SQL has a complication that (thankfully) Morel does not: you are allowed to use DISTINCT in the same query.)

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