A few days ago I asked a question to get data from a database linking several tables with **INNER JOIN**
.
Now I'm trying to mix the INNER
and the COUNT
but I do not know how to express it.
I have these tables.
What I want to do is a query that takes from a range of dates the list of clients ordered by the number of classes they have reserved in that period.
The query I did a few days ago, did something similar. Show reservation name and customer name.
SELECT cl.nombre,c.nombre From wp_ac_reservas r
INNER JOIN wp_ac_clases cl on r.id_clase =cl.id
INNER JOIN wp_ac_clientes c on c.id = r.id_usuario
WHERE r.fecha_reserva BETWEEN '2017-01-01' AND '2017-03-31'
But now I need only Client name, last name and number of reservations from x to x date (you would have to enter a count
by means of I guess)
I already appreciate the interest.