User table has an ipAddress column, & userid column as pk...maybe more than one user has the same ip!
UserActivity table has userid as fk, and activityid which is fk to activity table
So, I'm trying to get a count of how many rows in the user activity table (for a given activity id) have a userid which matches _any_ user with a given ip.
something like this? ( but correct and using joins, since my subselects are always crazy slow )
select count(*) from useractivity where userid in ( select userid from useractivity where activityid = x and user table.ip = Y )
Thanks for any help!