Friday 15 January 2010

mysql - SQL query error - Selecting from table with conditions -


I am currently trying to figure out how to match my needs in the <0> Modelid , where id = 553 and creature_template table column displayid update with the ID that is selected only but only if entry = 100098.

I have written to this SQL:

  UPDATE `creature_template` SET` modelid1` = (Select 'Model' from 'Creature' where` map` = 553) Where `s   

But when I add it to my database, I get this error:

The subkey provides more than 1 line.

Your subquery returns more than one value, creature < There are more than 553 rows in the map field with / code>. This query will update only one of those lines.

  Update the `animal 'template` STD model ID 1` (` `animal' WHERE` map` =` 553 select from range 'model`) where `entry' = 100098   

But if you need it to update all the rows with map = 553, you should use the IN reason:

  UPDATE `creature_template` SET` modelid1` IN (SELECT` creature `with model id` WHERE` map` = 553) where `entry '= 100098    

No comments:

Post a Comment