[thelist] mysql query syntax using max(id)

George Fitzsimmons unopimento at hotmail.com
Sat Oct 5 21:43:01 CDT 2002

[ Picked text/plain from multipart/alternative ]
I can't seem to get the syntax right for this mySQL query:
$query = "SELECT news_id, news_article FROM sb_news WHERE news_id = max(news_id) limit 1";

The goal of the query is to select the highest 'news_id' and display the 'news_article' for only that id.  Any tips?


More information about the thelist mailing list