NESTED QUERY in MySQL 4.3.3

NESTED QUERY in MySQL 4.3.3

am 28.02.2004 21:23:46 von alberto

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.htm l

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/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: NESTED QUERY in MySQL 4.3.3

am 28.02.2004 21:31:02 von Sinisa Milivojevic

Alberto writes:
> 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.htm l
>
> 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
>
>
> Any suggestion?
>
> Thanks,
> Albert
>

Sorry, we do not have version 4.3.3.

Please report back a correct version


--

Sincerely,

--
For technical support contracts, go to https://order.mysql.com/?ref=msmi
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB
/_/ /_/\_, /___/\___\_\___/ Full time Developer and Support Coordinator
<___/ www.mysql.com Larnaca, Cyprus

Meet the MySQL at User Conference ! (April 14-16, 2004)
http://www.mysql.com/uc2004/


--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: NESTED QUERY in MySQL 4.3.3

am 02.03.2004 10:08:53 von Sanja Byelkin

Hi!

On Sat, Feb 28, 2004 at 09:23:46PM +0100, Alberto wrote:
> 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.htm l
>
> 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

It looks like version less then 4.1, where subqueries is not supported.


--
Want to swim with the dolphins? (April 14-16, 2004)
http://www.mysql.com/uc2004/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Oleksandr Byelkin
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer
/_/ /_/\_, /___/\___\_\___/ Lugansk, Ukraine
<___/ www.mysql.com

--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org