473,320 Members | 1,612 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 1293
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Donald Tyler | last post by:
Then the only way you can do it that I can think of is to write a PHP script to do basically what PHPMyAdmin is trying to do but without the LOCAL in there. However to do that you would need to...
0
by: Jim Williams | last post by:
I am not able to get MYSQL running on Suse Linux Enterprise Server. I tried stopping with the command mysqld and it reported, "Shtudown Complete." Then when I tried to restart it with the...
0
by: Mike Chirico | last post by:
Interesting Things to Know about MySQL Mike Chirico (mchirico@users.sourceforge.net) Copyright (GPU Free Documentation License) 2004 Last Updated: Mon Jun 7 10:37:28 EDT 2004 The latest...
4
by: news | last post by:
Our production database in an exported textfil runs about 60 MB. Compressed that's about 9 MB. I'm trying to import the export into another machine running FC3 and mySQL 11.18, and it appears as...
5
by: Carlo Tambuatco | last post by:
I have set up MySQL on my home computer, and I am writing a PHP enabled web site to run queries on this database. I have created a database called 'weather' on mysql that I want to access via my...
5
by: smatta | last post by:
I have just installed MySql version 5.0-18 on Red Hat Fedora Core 4. It is running but I cant connect to it using MySql Query Browser running on my pc. >From my pc, I can telnet to the sql...
3
by: kription | last post by:
Here's my installation issue: I have two versions of an application (I'll refer to it as "ABC"). One version of the tool requires MySQL 4.1.x and the other requires MySQL 5.0.x, which is not an...
4
by: Richard | last post by:
Hi All, I've been trying to build a Ruby-on-Rails plus MySQL application. I'm running Ruby 1.8.2, Rails 1.1.4 and MySQL 5.0.15-nt over WinXP-Pro/SP2. I run under an Administrative account. ...
6
Atli
by: Atli | last post by:
This is an easy to digest 12 step guide on basics of using MySQL. It's a great refresher for those who need it and it work's great for first time MySQL users. Anyone should be able to get...
11
by: Robin S. | last post by:
I've used phpinfo() to confirm settings for mySQL on our host server, and it's not returning accurate info. phpinfo() returns a mySQL client API version of 3.23.54 (uselss for me), where as a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.