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

count distinct #26

Closed
Hasnabruzzn opened this issue Feb 4, 2024 · 3 comments
Closed

count distinct #26

Hasnabruzzn opened this issue Feb 4, 2024 · 3 comments
Assignees
Labels
discuss Discussion thread in-content Things in lessons request-change Please change something

Comments

@Hasnabruzzn
Copy link

Hasnabruzzn commented Feb 4, 2024

I would add count (distinct...) to 019: counting

select count(*) as count_star, count(sex) as count_specific, count(distinct sex) as count_sexes
from penguins;
| count_star | count_specific |count_sexes
|------------|----------------|------------|
| 344        | 333            | 2           |
  • count(*) counts rows
  • count(column) counts non-null entries in column
  • count(distinct column) counts distinct non-null entries in column (can also be an expression)

Edit: Maybe count_sexes is not the best example...

@gvwilson
Copy link
Owner

gvwilson commented Feb 6, 2024

thanks for the suggestion - why do you think count(distinct sex) isn't the best example? It seems to do the right thing?

@gvwilson gvwilson self-assigned this Feb 6, 2024
@gvwilson gvwilson added in-content Things in lessons request-change Please change something discuss Discussion thread labels Feb 6, 2024
@Hasnabruzzn
Copy link
Author

Hasnabruzzn commented Feb 6, 2024 via email

@gvwilson
Copy link
Owner

gvwilson commented Feb 6, 2024

thanks for the suggestion - if you could send me your name (gvwilson@third-bit.com) I'll add you to the acknowledgments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Discussion thread in-content Things in lessons request-change Please change something
Projects
None yet
Development

No branches or pull requests

2 participants