You cannot use update on two tables. Check the mysql manual on syntax of update.
Haifeng ----- Original Message ----- From: "Lai" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, March 19, 2003 1:43 PM Subject: This query shouldn't be wrong, but mysql says it is??? > Hi. > > Here is my table design, my query and the error: > > mysql> describe poor; > +--------+----------------+------+-----+---------+----------------+ > | Field | Type | Null | Key | Default | Extra | > +--------+----------------+------+-----+---------+----------------+ > | cc | char(2) binary | | | | | > | width | int(1) | YES | | NULL | | > | height | int(1) | YES | | NULL | | > | data | blob | YES | | NULL | | > | id | int(11) | | PRI | NULL | auto_increment | > | target | int(11) | YES | | NULL | | > +--------+----------------+------+-----+---------+----------------+ > > mysql> describe pindex; > +----------+----------------+------+-----+---------+----------------+ > | Field | Type | Null | Key | Default | Extra | > +----------+----------------+------+-----+---------+----------------+ > | cc | char(2) binary | YES | | NULL | | > | count | int(11) | YES | | NULL | | > | contourc | blob | YES | | NULL | | > | contourv | blob | YES | | NULL | | > | densityc | blob | YES | | NULL | | > | densityv | blob | YES | | NULL | | > | id | int(11) | | PRI | NULL | auto_increment | > +----------+----------------+------+-----+---------+---------------- > mysql> update poor, pindex set poor.target=pindex.id where poor.cc=pindex.cc; > ERROR 1064: You have an error in your SQL syntax near ' pindex set poor.target=pindex.id where poor.cc=pindex.cc' at line 1 > > My query is almost exact as the example in mysql document. What is wrong with it? > > Thanks. > > > --------------------------------------------------------------------- > Before posting, please check: > http://www.mysql.com/manual.php (the manual) > http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > > --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php