--- Gleb Paharenko <[EMAIL PROTECTED]> wrote:
> Hello.
>
> What about this:
>
> UPDATE news
> SET comments =
> (
> SELECT COUNT(id)
> FROM comments
> WHERE newsid = news.id
> GROUP BY newsid
> );
>
>
Isn't the previous query going to update the
news.comments with the last count from the sub-query?
Enrique Sanchez Vela
email: [EMAIL PROTECTED]
-----------------------------------------------------------------------------
It's often easier to fight for one's || We live in the outer space
principles than to live up to them || Rev. Kay Greenleaf
Adlai Stevenson ||
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]