|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
RE: !! Help with query: Where Date = MAX(Date)
From: Graham Cossey (graham
cossey.plus.com)
Date: Fri Feb 04 2005 - 10:34:47 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
<snip>
> > As I'm using 4.0.20 I can't use subqueries so how can I create
> a query that
> > does this?
> >
> > SELECT year, month
> > FROM `dc_months`
> > WHERE start_date = (SELECT MAX(start_date)
> > from dc_months
> > where start_date <= '20050204')
> >
> > Any help much appreciated
> >
> > Graham
> >
> >
>
> have a look here :
> http://dev.mysql.com/doc/mysql/en/example-maximum-column-group-row.html
> it should be useful for you.
>
Thanks Philippe that could do it.
Graham.
> --
> Philippe Poelvoorde
> COS Trading Ltd.
> +44.(0)20.7376.2401
>
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]