RE: Right syntax for max value??

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[snip]
$getnewstitle = "SELECT newstitle FROM `news` WHERE news_id = ( SELECT
max( news_id ) FROM news ) ";

Does anybody know the right syntax?
[/snip]


Yes, people on the MySQL list.

Actually you do not need the sub-select here (your remote host may not
have a MySQL version that supports sub-queries)....

$getnewstitle = "SELECT MAX(news_id), newstitle FROM `news` ";

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux