I have a grails application with a mysql database as the datasource. The mysql database is created and maintained by a third party. One of the tables 'visitinfo'
contains 2 columns consisting of the 'userid'
and 'logindatetime'
.
userid
is of type TEXT and logindatetime is of type 'datetime'.
In order to access the above table 'visitinfo'
, I have created a domain class 'VisitInfo' and mapped it to the mysql database table by which my grails application can easily store as well as retrieve data from the database.
On one of the pages, I am required to show visitor information for the last 30 days. So basically I am looking out for a solution to get number of visitors per day for the last 30 days. Something like this:
21-Jan-2012 ------ 36
22-Jan-2012 ------ 85
23-Jan-2012 ------ 115
24-Jan-2012 ------ 236
etc.
Also please note, that if a userid 'williamp'
has 2 entries on a particular day, it should be counted as 2. So, am not looking out for uniqueness of users.
Any help will be appreciated.