Hi Erwin

Try

Select afield from atable where index=(select max(index) from atable);

[]s

Paulo Botelho


----- Original Message -----
From: "Erwin Hogeweg" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 07, 2002 12:47 PM
Subject: Neede MySQL query Equivalent.


> Hi,
>
> Could somebody please help me with the following. I want an equivalent
for:
> select afield from atable where max(index) = index;
>
> I tried this, and that works, but it seems to me that there is a better
> (cleaner) way to accomplish the same.
> select afield from atable order by index desc limit1;
>
>
> regards,
>
> Erwin
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to