Slide 128
Slide 128 text
SELECT
prefs.id,
prefs.name,
COUNT(*)
FROM
clients
INNER JOIN prefs ON clients.pref_id = prefs.id
INNER JOIN entries ON clients.id = entries.client_id
WHERE
entries.date BETWEEN '2013-02-01 00:00:00' AND '2013-02-31 23:59:59'
AND prefs.name = '౦ژ'
GROUP BY
prefs.id,
prefs.name
ORDER BY
prefs.id,
prefs.name
;