Jump to content

subqueries


skiplogic

Recommended Posts

I am tearing my hair out! Any help would be appreciated!

Here's some valid SQL that wont run on my local (osx) install of mysql 5:

yo-mamas-Computer:~/buthu/linkback bryan$ mysql -V
mysql  Ver 14.12 Distrib 5.0.24a, for apple-darwin8.6.0 (powerpc) using readline 5.0
yo-mamas-Computer:~/buthu/linkback bryan$ mysql test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 38 to server version: 4.0.24-standard

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
<b>
mysql> select 1 from (select 1 from dual) b;
ERROR 1064 (00000): 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 1 from dual) b' at line 1
</b>

But it works on the BSD box, which is apparently running an older version of mysql

-bash-2.05b$ mysql -V
mysql  Ver 14.7 Distrib 4.1.19, for portbld-freebsd5.4 (i386) using  4.3
-bash-2.05b$ brydev
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 793946 to server version: 5.0.22

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
<b>
mysql> select 1 from (select 1 from dual) b;
+---+
| 1 |
+---+
| 1 |
+---+
1 row in set (0.01 sec)</b>

What gives?
Link to comment
Share on other sites

[quote author=fenway link=topic=107577.msg432076#msg432076 date=1157983462]
How?
[/quote]

mysql -V prints the version of the client software, not the version. If you look at the login messages from each of the spools that I quoted above, you'll notice that the bsd box is running v 5, while the osx is running v 4. I guess subqueries weren't added until after 4...
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.