My apologies for not making the question as specific as it needed to be for the assist, I'm still trying to learn what the questions are and how to ask them.
mrunals, that is pretty close to what I'm looking for and possibly because my question was asked incorrectly, I'll try to rephrase the question.
Users can login multiple times a day and query the database multiple times a day. So, the users name will appear in the log numerous times in a day sometime up to 50 times, so uniqueness of the user is important but also the number of logins as this would determine the ranking of the users. I'm trying to show how many times in a month/week/year that Fred/Mary/George have logged in and the databases that they have logged into, displaying the top 15 users for each database, by ranking.
In a 7day look I would anticipate seeing all the databases listed with the top 15 users, most users will have logged in daily and would have a count of 7, others less. The ranking (number of time Fred is in the log for the day) would help determine the top users (Fred logged in multiple times and Mary only once so Fred would be ranked higher than Mary).
Hopefully this helps better describe what I'm trying to accomplish.
mrunals, can you help me understand how your suggestion is supposed to work? bin, is that getting a unique set of data for 1day then getting distinct (_time) and counting? shouldn't changing the span from 1d to 7d cause UniqueDays to be 7 instead of 1?
Thanks,
... View more