I'm fairly new to subqueries/joins but I need to run a query on a table table that was generated from another query. I know this has probably been asked before, but I have not been able to find an answer that works form me.
Basic info about my queries:
query 1:
SELECT ipAddress,userId FROM loginAttempts WHERE browser = 'IE' GROUP BY userId
query 2:
SELECT COUNT(ipAddress) AS rows,ipAddress FROM loginAttempts GROUP BY ipAddress ORDER BY ipAddress;
Mainly I need to preform a search to only show unique values that reach certain criteria then show a count of how many of each unique values are returned from that.
This is a simplified version of my queries, but the loginAttempts table tracks each login attempt from each user, and I need to see how many login attempts were made from each IP address from each user. For example...
user1, 5 attempts from x.x.x.4
user1, 2 attempts from x.x.x.5
user2, 10 attempts from x.x.x.4
user2, 2 attempts from x.x.x.6
etc...
Thank you in advance for your help!