I am trying to do exactly what the title says, get the total number of records and the number of records that are unique in a certain column.
What I tried so far
SELECT COUNT(ip) AS visits, ip FROM tracker WHERE time BETWEEN ? AND ? GROUP BY ip
SELECT DISTINCT COUNT(ip) AS visits, ip FROM tracker WHERE time BETWEEN ? AND ?
SELECT DCOUNT(ip) AS visits, DISTINCT(ip) AS `unique` FROM tracker WHERE time BETWEEN ? AND ?
However none of these brought me pleasant feelings.. How can I do this?