NESTED QUERY in MySQL 4.3.3

Alberto <[email protected]>
Newsgroups gmane.comp.db.mysql.bugs
Message-ID <[email protected]>
Hi to all, i've installed the MySQL 4.3.3 and a nested query don't work...

The query is:

SELECT ID FROM USER_ACCESS WHERE MOMENT = (SELECT MAX(MOMENT) FROM USER_ACCESS)

The query is very similar to the example i've found in the online 
documentation at the address
http://www.mysql.com/doc/en/Comparisons_using_subqueries.html

The error reported is:

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(MOMENT) FROM USER_ACCESS)' at line 1


The table is of type InnoDB:

CREATE TABLE USER_ACCESS (

ID INTEGER NOT NULL AUTO_INCREMENT,
ID_USER INTEGER NOT NULL,
MOMENT DATETIME,
IP_ADDRESS CHAR(40),
HOST_NAME  CHAR(50),
BROWSER_NAME CHAR(10),
BROWSER_TYPE CHAR(10),
BROWSER_VERSION CHAR(10),
OS CHAR(10),
GRANTED BOOL,
NOTES VARCHAR(25),
PRIMARY KEY(ID),
INDEX user_access_id_user (ID_USER),
FOREIGN KEY(ID_USER) REFERENCES USERS(ID) ON DELETE CASCADE
) TYPE = InnoDB;


where the table USER is:

CREATE TABLE USERS (


ID INTEGER NOT NULL AUTO_INCREMENT,
NAME CHAR(20),
SURNAME CHAR(20),
TEL CHAR(15),
FAX CHAR(15),
EMAIL CHAR(30),
USR CHAR(20) UNIQUE,
PWD CHAR(20),
ENABLED BOOL DEFAULT 1,
PROFESSOR BOOL DEFAULT 1,
SUPERUSER BOOL DEFAULT 0,
PRIMARY KEY(ID)
) TYPE = InnoDB;


Any suggestion?

Thanks,
Albert



-- 
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe:    http://lists.mysql.com/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.