List:General Discussion« Previous MessageNext Message »
From:Chuzo Okuda Date:April 8 2005 8:36pm
Subject:ERROR 1064: You have an error in your SQL syntax....
View as plain text  
I am a newbie here. I created a simple table defined as:

create table test (
   testID       int unsigned not null auto_increment,
   testName     varchar(128) not null,
   primary key (testID)
) type = MyISAM;

Now, I filled out test table, and looking for the testName with max 
characters.

The following caused the same error of:
ERROR 1064: You have an error in your SQL syntax.  Check the manual that 
corresponds to your MySQL server version for the right syntax to use 
near 'select max(length(testName)) from test)' at line 1


select testName from test where length(testName) = (select 
max(length(testName)) from test);

Then I copied a simple line from MySQL book:

select * from president where birth = (select min(birth) from president);

and adapted to my table with:

select * from test where testName = (select min(testName) from test);

and executed it with exactly the same error result.

MySQL version I am using is: 4.0.21-standard

Please help me why I get this error.
Thank you
Chuzo
Thread
ERROR 1064: You have an error in your SQL syntax....Chuzo Okuda8 Apr
  • Re: ERROR 1064: You have an error in your SQL syntax....Peter Brawley8 Apr