As you can see in the day column I have two days "po" and "20", what I need is a query that returns the number of days that are registered, which in this case is 2.
I have this:
SELECT COUNT(*) AS total FROM juego WHERE fecha = '2018-12-23' GROUP BY jornada
It seems to me that your query is well started, the only thing is that in the aggregation function COUNT()instead of the wildcard you *directly pass the name of the column you want to count
SELECT COUNT(jornada) AS Total
FROM juego
GROUP BY fecha;
Now for the sample of data that you place I see unnecessary the use of WHERE fecha = ...since all your data have the same date
It seems to me that your query is well started, the only thing is that in the aggregation function
COUNT()
instead of the wildcard you*
directly pass the name of the column you want to countNow for the sample of data that you place I see unnecessary the use of
WHERE fecha = ...
since all your data have the same dateI found the solution, remove the grouping and add the distinct modifier to count the distinct elements