On Wed, 2003-10-08 at 15:06, Mark Wilson wrote:
> Er, I _used_ a "basic SQL tutorial", which specifically said that this should
> work.  The problem seems to be a limitation of MySQL, not general SQL operation.
> That being said, are there any clever one-query options (using JOINs, etc?) or
> is this basically a 2-step process in MySQL?

Actually I just reread the SQL.  MySQL 3 douse not support sub-queries.
I think 4 might and I think subqueries are in the ANSI 95 SQL standard
(or was it 92).

It douse have to be done in a two step operation for this type of max
function.  

The other option, if you can order the query, is to use the LIMIT clause
(mysql specific).  LIMIT x,y, x=first row and y=number of rows.  So if
you ordered your query with the row you wanted first add LIMIT 1,1 at
the beginning.

Ben
-- 
****************************************************************
* Ben Edwards           Tel +44 (0)1179 553 551  ICQ 42000477  *
* Homepage - nothing of interest here   http://gurtlush.org.uk *
* Webhosting for the masses         http://www.serverone.co.uk *
* Critical Site Builder    http://www.criticaldistribution.com *
* online collaborative web authoring content management system *
* Get alt news/views films online   http://www.cultureshop.org *
* i-Contact Progressive Video      http://www.videonetwork.org *
* Fun corporate graphics             http://www.subvertise.org *
* Bristol Indymedia               http://bristol.indymedia.org *
* Bristol's radical news             http://www.bristle.org.uk *
****************************************************************


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

Reply via email to