Gleb Paharenko wrote:

Hello.



What about this:



UPDATE news

SET comments =

(

 SELECT COUNT(id)

FROM comments WHERE newsid = news.id
        GROUP BY newsid

);
Hi. i came up with a similar query last night, but i didnt use group by.
I have question, it it better to use COUNT(*) ? i thought there is extra mysql optimization when you use *

thanks.


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.10.2/65 - Release Date: 8/7/2005


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to