Yes - you must use the subselect.  Or, you can set a variable like:

select @max := max(movid) from table_name;
select * from table_name where movid = @max;


On Sat, Feb 6, 2010 at 8:34 AM, tech list <bluetm...@gmail.com> wrote:

> select * from table_name where movid = max(movid);
>
> why the sql above can't work?
> Shall I use a sub-select instead?
>
> select * from table_name where movid = (select max(movid) from table_name)
> ?
>
>
> Thanks in advance.
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql?unsub=jlyons4...@gmail.com
>
>


-- 
Jim Lyons
Web developer / Database administrator
http://www.weblyons.com

Reply via email to