var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: cross platform derived table query/subquery in from clause
It's like this, I have a table of searchstrings that I want to list based on unique searchstrings and unique users(because some users search for the exact same thing many times)
id, searchStr, remote_addr, was_answered
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
I checked the mysql documentation and it seems mysql needs to put in an "as" before "tb", but it still won't work.
Is there a standard for this question, some way that I can make it work on both platforms?
Edit: is this thing really called derived table or is it just a subquery? English is not my native language.
Last edited by daytripper; 01-22-04 at 13:11.
Re: cross platform derived table query/subquery in from clause
A subquery in the FROM clause is usually called an "inline view" (or at least, it is in Oracle circles). Whether mySQL supports inline views at all, I don't know.