Re: This query shouldn't be wrong, but mysql says it is???

2003-03-19 Thread Lai Liu-yuan
I reread the mysql manual again, and found the little piece I've missed : version 4!! 
That's the problem.

Thanks for your reply.

-
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



This query shouldn't be wrong, but mysql says it is???

2003-03-18 Thread Lai
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



Re: This query shouldn't be wrong, but mysql says it is???

2003-03-18 Thread Liu Haifeng
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



Re: This query shouldn't be wrong, but mysql says it is???

2003-03-18 Thread Paul DuBois
At 22:43 -0700 3/18/03, Lai wrote:
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?
Your version of MySQL, very likely.  What is it?

Thanks.


--
Paul DuBois
http://www.kitebird.com/
sql, query
-
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