SELECT h.historyid, h.searchstring, h.serverid, s.shortname
FROM history h
  INNER JOIN servers s ON h.serverid = s.serverid
WHERE h.employeeid = 9
ORDER BY h.historyid DESC limit 20;
                          ^^^^^^^^^

You probably mean LIMIT to limit.  

On Mon, 2003-07-14 at 17:12, Jim McAtee wrote:
> What's wrong with the following query?  The application used to use Access via
> ODBC, now running MySQL 3.23.xx, MyISAM table, accessed via MyODBC 3.51.01.
> 
> // Return last 20 searches
> SELECT TOP 20 h.historyid, h.searchstring, h.serverid, s.shortname
> FROM history h
>   INNER JOIN servers s ON h.serverid = s.serverid
> WHERE h.employeeid = 9
> ORDER BY h.historyid DESC
> 
> Works fine once I remove the "TOP 20" from the query.  If this isn't supported,
> is there an equivalent?
> 
> Thanks,
> Jim
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
-- 
Woody

In a world without boundaries why
do we need Gates and Windows?


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to