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

HELP: How make COUNT query? #294

Open
scorday opened this issue Nov 21, 2024 · 2 comments
Open

HELP: How make COUNT query? #294

scorday opened this issue Nov 21, 2024 · 2 comments

Comments

@scorday
Copy link

scorday commented Nov 21, 2024

Hello. Could not find any information in docs or in code on howto make COUNT query.

@Pentusha
Copy link
Owner

It seems there is no convenient way to make a count right now.
Just in case, write an example of the EdgeDB query that you would like to express.
I will make a PR with the addition of this functionality in the near future.

@scorday
Copy link
Author

scorday commented Nov 25, 2024

@Pentusha I found workaround and use:

with items := (select Foo { id }) select Foo { total := count(items) } limit 1;

But it seems kinda...

General SELECT COUNT Foo WHERE... would be nice.
Also, what about SELECT DISTINCT Foo.bar WHERE ... ?

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

2 participants