473,504 Members | 13,746 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Does MySQL (4.0.20-standard) allow subqueries???

Im moving a development app (MySQL 5.0) to a different server which
runs MySQL 4.0.20-standard. I am getting errors on queries that have
subqueries such as...

SELECT id
FROM table1
WHERE id IN (
SELECT id FROM table1
)

Seems like such a simple query but it wont run? Anybody know the
answer and what other limitations im going to experience going from
version 5.0 down to 4.0.20-standard. -Nick
Jul 20 '05 #1
5 2413
Nick wrote:
Im moving a development app (MySQL 5.0) to a different server which
runs MySQL 4.0.20-standard. I am getting errors on queries that have
subqueries such as...

SELECT id
FROM table1
WHERE id IN (
SELECT id FROM table1
)

Seems like such a simple query but it wont run? Anybody know the
answer and what other limitations im going to experience going from
version 5.0 down to 4.0.20-standard. -Nick


Subqueries are not supported in 4.0.x but will be in 4.1.x

The manual's always a good start for finding out what is and is not
available in MySQL.

This page has a feature list of what's in 4.0.x
http://dev.mysql.com/doc/mysql/en/Nu..._features.html

This page has a feature list of what's in 4.1.x
http://dev.mysql.com/doc/mysql/en/Nu..._features.html

This one has planned features for 5.0
http://dev.mysql.com/doc/mysql/en/TODO_MySQL_5.0.html

By reading each of those and comparing, you'll be able to see what the
difference between them is.

--
Chris Hope - The Electric Toolbox - http://www.electrictoolbox.com/
Jul 20 '05 #2
Nick wrote:
Seems like such a simple query but it wont run? Anybody know the
answer and what other limitations im going to experience going from
version 5.0 down to 4.0.20-standard. -Nick


Subqueries are not supported in version 4.0.x of MySQL.
MySQL 4.1 introduced support for subqueries.

See:
http://dev.mysql.com/doc/mysql/en/AN...ubqueries.html

And here's a page to help rewriting some types of subqueries as joins:
http://dev.mysql.com/doc/mysql/en/Re...ubqueries.html

There are many, many changes between 4.0 and 5.0. I cannot guess what
features you are using that were introduced after 4.0.

Try starting here: "C. MySQL Change History"
http://dev.mysql.com/doc/mysql/en/News.html

Regards,
Bill K.
Jul 20 '05 #3
There is a paper on mysql explaining the work around for subqueries.
SELECT id
FROM table1
WHERE id IN (
SELECT id FROM table1
)

this for example, even in mysql 5.0 I would run as

Select a.id
From table1 a, table1 b
Where a.id = b.id
Jul 20 '05 #4
Great...... Anyone know of a good webhost that offers MySQL 4.1+ or
Postgres??? This is going to add alot of time to the project.

-Nick
Jul 20 '05 #5
Nick wrote:
Great...... Anyone know of a good webhost that offers MySQL 4.1+ or
Postgres??? This is going to add alot of time to the project.


There is unlikely to be any who have MySQL 4.1 yet because it's still in
beta. And there certainly won't be any hosts with 5.0 because that's alpha
software. If your main problem is subqueries you can often rewrite them
using joins, or use code to create the in() part of the clause (a little
slow, I know). Otherwise, there are plenty of hosts with Postgres - do a
Google search on --> hosting postgres <-- and look at all the sponsored
links.

--
Chris Hope - The Electric Toolbox - http://www.electrictoolbox.com/
Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4692
by: valexena | last post by:
Does PL/SQL allow cursors to contain subqueries? -- Posted via http://dbforums.com
0
4930
by: Dan Anderson | last post by:
I ran a search through the mySQL manual and google and could not find a satisfactory answer. Does mySQL support the declaration of a boolean data type? Currently I am using VARCHAR(6)s with...
0
4215
by: laurie | last post by:
Hi all, Does MySQL support inheritance? i.e. I have Teacher, Student, etc. and they all inherit from Person because they share common attributes (name, address, etc). I believe MySQL is not Object...
2
4525
by: David Nettles | last post by:
Two questions: (1) Does MySQL support VIEWS? (2) Does MySQL support STORED PROCEDURES? -- David Nettles web: http://www.miteyo.org email: tetsuoni3000@yahoo.co.jp
0
2610
by: Christopher Koh | last post by:
Does MYSQL support transactions like rollback and commit now? How about stored procedures and subqueries?
2
1717
by: c-bass | last post by:
How many database does MySQL Support?
0
2167
by: Andrew Crook | last post by:
does MYSQL have a quota built into it! I need it limit the size of each database AndiC
1
1377
by: pratapkonakala | last post by:
Does Mysql Server have JVM in it.I want to know can we write java stored procedures in Mysql server itself.If possible please provide me the solution.
2
5707
by: shreedhan | last post by:
Hi I am just learning mysql and php I use Fedora 6 for that One thing I would like to ask is where does mysql store all those information? like tables, databases, all? I would like to save them...
2
8770
bagrigsb
by: bagrigsb | last post by:
Recently I downloaded the latest version of MySQL for 32-bit, installed it. No errors installing it. When I go to run it though, all it does is flash a DOS-like window for a fraction of a second...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7298
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7366
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5610
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4698
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.