update myqsl table

Posted by Simon on Stack Overflow See other posts from Stack Overflow or by Simon
Published on 2010-03-15T21:43:11Z Indexed on 2010/03/15 21:49 UTC
Read the original article Hit count: 268

Filed under:
|

how can i write the query, to update the table videos, and set the value of field name to 'something' where the average is max(), or UPDATE the table, where average has the second value by size!!!

i think the query must look like this!!!

UPDATE videos 
   SET name = 'something' 
 WHERE average IN (SELECT `average`
                     FROM `videos`
                 ORDER BY `average` DESC
                    LIMIT 1)

but it doesn't work!!!

© Stack Overflow or respective owner

Related posts about mysql

Related posts about update