470,594 Members | 1,471 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,594 developers. It's quick & easy.

Mysql version issue

A colleague of mine is having problems on our system.

He is running a mysql command on his local setup which runs 4.1.7 -nt
and which works fine.

However this fails when uploaded to the server which is running
4.0.20. The error and the command is

Database sovaproj - Table contractsnew2 running on db
Error
SQL-query :

DELETE FROM contracts WHERE ProjectKey NOT IN
(SELECT ProjectKey FROM contractsnew2)

MySQL said:

#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 ProjectKey
FROM contractsnew2 )' at line 1

A search of google and the mysql manual shows that there are
differences in the versions which is causing problems for some but I
couldn't see how in this case.

Any thoughts or ideas greatly appreciated.

Thanks

--
John

Dec 3 '05 #1
3 1188
I am not 100% sure but I feel that 4.0.20 doesn't support subqueries.
"John" <ybghbjdo@dfsrtfu> wrote in message
news:q6********************************@4ax.com...
A colleague of mine is having problems on our system.

He is running a mysql command on his local setup which runs 4.1.7 -nt
and which works fine.

However this fails when uploaded to the server which is running
4.0.20. The error and the command is

Database sovaproj - Table contractsnew2 running on db
Error
SQL-query :

DELETE FROM contracts WHERE ProjectKey NOT IN
(SELECT ProjectKey FROM contractsnew2)

MySQL said:

#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 ProjectKey
FROM contractsnew2 )' at line 1

A search of google and the mysql manual shows that there are
differences in the versions which is causing problems for some but I
couldn't see how in this case.

Any thoughts or ideas greatly appreciated.

Thanks

--
John

Dec 3 '05 #2
John wrote:
A colleague of mine is having problems on our system.

He is running a mysql command on his local setup which runs 4.1.7 -nt
and which works fine.

However this fails when uploaded to the server which is running
4.0.20. The error and the command is

Database sovaproj - Table contractsnew2 running on db
Error
SQL-query :

DELETE FROM contracts WHERE ProjectKey NOT IN
(SELECT ProjectKey FROM contractsnew2)


No subqueries support in 4.0.x or earlier versions.

You will either have to first fetch the "SELECT ProjectKey FROM contractsnew2"
and then add all that to the IN statement in the DELETE query, or just update
the MySQL (this requires you make a backup of all the databases, uninstall the
4.0.x and then install 4.1.x and then restore the backup).
//Aho
Dec 3 '05 #3
On Sat, 03 Dec 2005 12:03:12 +0100, "J.O. Aho" <us**@example.net>
wrote:
John wrote:
A colleague of mine is having problems on our system.

He is running a mysql command on his local setup which runs 4.1.7 -nt
and which works fine.

However this fails when uploaded to the server which is running
4.0.20. The error and the command is

Database sovaproj - Table contractsnew2 running on db
Error
SQL-query :

DELETE FROM contracts WHERE ProjectKey NOT IN
(SELECT ProjectKey FROM contractsnew2)


No subqueries support in 4.0.x or earlier versions.

You will either have to first fetch the "SELECT ProjectKey FROM contractsnew2"
and then add all that to the IN statement in the DELETE query, or just update
the MySQL (this requires you make a backup of all the databases, uninstall the
4.0.x and then install 4.1.x and then restore the backup).


Thanks for that and to Simon.
I will attempt to get our server upgraded.

--
John
Dec 3 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Donald Tyler | last post: by
reply views Thread by Mike Chirico | last post: by
4 posts views Thread by news | last post: by
5 posts views Thread by Carlo Tambuatco | last post: by
Atli
6 posts views Thread by Atli | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.