@Greg-Plamondon Try these queries:
Get a list of (unique) host IDs where username logged in to:
SELECT DISTINCT utHostID FROM userTracking WHERE utUserName LIKE '%username%';Now combine this query to get the list of hostnames as well:
SELECT hostID,hostName FROM hosts WHERE hostID IN (SELECT DISTINCT utHostID FROM userTracking WHERE utUserName LIKE '%username%');Be aware that the first query might return more results than the later one because older user tracking entries will still exist even if you delete a host from your database. In that case the later query won’t return this host.