I'm using HeidiSQl and trying to run a query where I get all the users from table 1 and then count all the matching users in table 2.
SELECT DISTINCT problem, title, username, createdate, expiredate
FROM solutionhistory as table1
INNER JOIN (SELECT COUNT(LOGIN_NAME) FROM ra_report_table) as table2
WHERE username != 'test'
Your query doesn't make sense on a lot of levels. I am guessing you intend something more like this:
SELECT problem, title, username, createdate, expiredate, table2.cnt FROM solutionhistory as table1 INNER JOIN (SELECT LOGIN_NAME, COUNT(LOGIN_NAME) as cnt FROM ra_report_table GROUP BY LOGIN_NAME ) as table2 ON table1.username = table2.LOGIN_NAME WHERE username <> 'test' LIMIT 10