472,354 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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 2313
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
by: valexena | last post by:
Does PL/SQL allow cursors to contain subqueries? -- Posted via http://dbforums.com
0
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
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
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
by: Christopher Koh | last post by:
Does MYSQL support transactions like rollback and commit now? How about stored procedures and subqueries?
2
by: c-bass | last post by:
How many database does MySQL Support?
0
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
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
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
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...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. header("Location:".$urlback); Is this the right layout the...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...

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.