help with SQL syntax error
Posted: Sun Apr 11, 2004 4:10 am
Hello
I am new to SQL and I ran into a small syntax problem
I am trying to run the following SQL query which results in a syntax error which I cannot find:
SELECT COUNT(*) FROM individual_tbl WHERE (Last_name LIKE '%na%' AND ID IN (SELECT ID, Last_name FROM individual_tbl WHERE (Last_name LIKE 'N%')));
Here is the definition of individual_tbl:
CREATE TABLE `individual_tbl` (
`ID` int(11) unsigned NOT NULL auto_increment,
`Last_name` varchar(100) default '',
PRIMARY KEY (`ID`)
) TYPE=MyISAM;
can anyone see the problem?
I am new to SQL and I ran into a small syntax problem
I am trying to run the following SQL query which results in a syntax error which I cannot find:
SELECT COUNT(*) FROM individual_tbl WHERE (Last_name LIKE '%na%' AND ID IN (SELECT ID, Last_name FROM individual_tbl WHERE (Last_name LIKE 'N%')));
Here is the definition of individual_tbl:
CREATE TABLE `individual_tbl` (
`ID` int(11) unsigned NOT NULL auto_increment,
`Last_name` varchar(100) default '',
PRIMARY KEY (`ID`)
) TYPE=MyISAM;
can anyone see the problem?