gvwilson / sql-tutorial

The Querynomicon: An Introduction to SQL for Wary Data Scientists
https://gvwilson.github.io/sql-tutorial/
Other
418 stars 35 forks source link

count distinct #26

Closed Hasnabruzzn closed 5 months ago

Hasnabruzzn commented 5 months ago

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           |

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

gvwilson commented 5 months ago

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

Hasnabruzzn commented 5 months ago

From a technical point of view it's fine. Maybe I'm just overreacting to some 'political' confusions.

Am 6. Februar 2024 15:15:08 MEZ schrieb Greg Wilson @.***>:

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

-- Reply to this email directly or view it on GitHub: https://github.com/gvwilson/sql-tutorial/issues/26#issuecomment-1929770471 You are receiving this because you authored the thread.

Message ID: @.***>

gvwilson commented 5 months ago

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