Manish,
What version of MySQL are you using?
The chances are subqueries are not supported in your version.
Try restructuring your query as a join like:
UPDATE
tbl1,
tbl2
SET
tbl1.col1=tbl1.col1+1
WHERE
tbl.ID = tbl2.ID
AND tbl2.status='Active'
http://dev.
Subqueries are not supported until mysql 4.1. I'm guessing you have an
earlier version. With version 4.0.4 or later, you can accomplish the same
thing with a multi-table update:
UPDATE tbl1, tbl2 SET tbl1.col1 = tbl1.col1 + 1
WHERE tbl1.ID = tbl2.ID AND tbl2.status='Active';
or equivalentl