MaRiOsGR Posted May 10, 2013 Share Posted May 10, 2013 Hello, is there any way to get the a report or something like that with the number of active domains per client? I would like to know who has the most. 0 Quote Link to comment Share on other sites More sharing options...
stormy Posted December 30, 2013 Share Posted December 30, 2013 I have been trying to download the CSV export of domains and try to filter in Excel but I can't get to that list. 0 Quote Link to comment Share on other sites More sharing options...
SeanP Posted December 30, 2013 Share Posted December 30, 2013 Try this SQL query: SELECT tblclients.firstname, tblclients.lastname, tblclients.companyname, tblclients.email, COUNT(tbldomains.id) AS 'domains' FROM tbldomains INNER JOIN tblclients ON tblclients.id = tbldomains.userid GROUP BY tbldomains.userid ORDER BY domains DESC; 0 Quote Link to comment Share on other sites More sharing options...
stormy Posted December 30, 2013 Share Posted December 30, 2013 That's great, thanks! I've been tinkering with this for the past few hours (I'm not a coder!) and arrived at this one myself, which is similar: SELECT tblclients.id, tblclients.firstname, tblclients.lastname, tblclients.email, COUNT( tbldomains.domain ) AS domains FROM tbldomains INNER JOIN tblclients ON tblclients.id = tbldomains.userid AND tbldomains.status = 'Active' GROUP BY userid ORDER BY `domains` DESC - - - Updated - - - Someone should turn this into a nice report… 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.