How many unique?
But what if we want to calculate the number of unique site visitors? Sounds like a combination of selecting unique and then counting...
Yes, that's the point! To calculate the number of unique observations over a certain column use COUNT(DISTINCT( ... )) statement. For example,
12SELECT COUNT(DISTINCT(user_id)) FROM visitors
This query will return a single value - the number of unique user_id in the visitors table.
Swipe to start coding
Count the number of different cars models in the audi_cars table.
Solución
¡Gracias por tus comentarios!
single
Pregunte a AI
Pregunte a AI
Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla
Genial!
Completion tasa mejorada a 2.63
How many unique?
Desliza para mostrar el menú
But what if we want to calculate the number of unique site visitors? Sounds like a combination of selecting unique and then counting...
Yes, that's the point! To calculate the number of unique observations over a certain column use COUNT(DISTINCT( ... )) statement. For example,
12SELECT COUNT(DISTINCT(user_id)) FROM visitors
This query will return a single value - the number of unique user_id in the visitors table.
Swipe to start coding
Count the number of different cars models in the audi_cars table.
Solución
¡Gracias por tus comentarios!
single