http://www.mysql.com/documentation/mysql/bychapter/manual_Introduction.html#ANSI_diff_Sub-selects

On Monday 15 April 2002 2:49 pm, Jeff Shipman wrote:
> Yeah, that nasty thing with temporary tables and
> such? Or am I looking at the wrong page? If you
> could point me in the right direction, I'd appreciate
> it (slow modem connection, etc).
>
> Christopher Thompson wrote:
> > Read the manual.  MySQL doesn't support subselects but offers you
> > alternatives.
> >
> > On Monday 15 April 2002 2:45 pm, Jeff Shipman wrote:
> >>I'm trying to do a fairly simple select of a
> >>column from a table where the date of that column
> >>happens to be the highest value. I tried this:
> >>
> >>SELECT name FROM products WHERE prod_type='foo' AND
> >>added=(SELECT MAX(added) FROM products WHERE
> >>prod_type='foo');
> >>
> >>But I get the error:
> >>
> >>ERROR 1064: You have an error in your SQL syntax
> >>near 'SELECT MAX(added) FROM products WHERE
> >>prod_type='foo')' at line 1
> >>
> >>Is there a problem with the parentheses? I've
> >>used this syntax with Oracle before with no
> >>troubles.
> >>
> >>name and prod_type are TINYTEXT and added is
> >>a DATE.
> >>
> >>Is there another way I should be doing this? I
> >>could probably order descending by the added date
> >>and then just LIMIT 1, but I don't think that's
> >>very clean.
> >>
> >>'mysql --version' returns:
> >>
> >>mysql  Ver 11.15 Distrib 3.23.41, for -freebsd4.4 (i386)
> >>
> >>Thanks in advance,

---------------------------------------------------------------------
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