This is the query that works on MS SQL server, but I can't get to work in MySQL:
SELECT ss, COUNT(DISTINCT ra) AS theCount
FROM (SELECT DISTINCT searchStr AS ss, remote_addr AS ra FROM tbl_savesearch) tb
GROUP BY ss
ORDER BY theCount DESC
table looks like this:
table tbl_savesearch
id, searchStr, remote_addr, was_answered
Tried to find an answer in the documentation, but the only thing I could find that is wrong is that mysql needs an "as" before the "tb" after the second inline query.
What do I need to change?