powelly Posted August 20, 2007 Share Posted August 20, 2007 I have the following data recording visitors to a site. DATE IPADDRESS 01/01/2007,192.168.1.1 01/01/2007,192.168.1.2 10/01/2007,192.168.1.1 10/01/2007,192.168.1.2 10/01/2007,192.168.1.3 11/01/2007,192.168.1.1 I want to select the number of unique ipaddresses per date and return something like this Date,UniqueIPs 01/01/2007,2 10/01/2007,3 11/01/2007,1 Could someone be kind enough to point me in the right direction? Link to comment https://forums.phpfreaks.com/topic/65820-solved-select-unique-records-by-date/ Share on other sites More sharing options...
kirk112 Posted August 20, 2007 Share Posted August 20, 2007 Something like this? SELECT COUNT(IPADDRESS) AS UniqueIPs, DATE FROM table_name GROUP BY IPADDRESS, DATE ORDER BY DATE Link to comment https://forums.phpfreaks.com/topic/65820-solved-select-unique-records-by-date/#findComment-328883 Share on other sites More sharing options...
powelly Posted August 20, 2007 Author Share Posted August 20, 2007 Perfect Thank you Link to comment https://forums.phpfreaks.com/topic/65820-solved-select-unique-records-by-date/#findComment-328962 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.