This current version includes redundant stuff because of previous export processes that allowed just the relevant databases to be included. These are easily skipped or deleted from the Text-only results when you past the results into a new query, such as http://data.stackexchange.com/stackoverflow/query/168043/accountid-comparison.
Q&A about the site for administrators, end users, developers and designers for Craft CMS
Select 'Select ''' + Replace([Name],'.Exported','') + ''' As [DatabaseName], ' + 'Count(*) As [Count] ' + 'From [' + [Name] + ']..Users fu Left Outer Join Users u ON fu.EmailHash=u.EmailHash' + ' Where ISNULL(u.EmailHash,'''')<>''''' + ' UNION ALL ' From sys.Databases Where Name Like '%.Exported'