This is true, although I believe you may have some backward
compatibility issues with other existing PHP/MySQL programs.
This is not confirmed, but I found problems with this on Windows (at
least) at home.
Still, quite an achievement for MySQL.
Also, if you just need a simple SQL db for small jobs, check out SQLite
(www.sqlite.org). It's fairly SQL 92 compliant; supports transactions,
subqueries, left outer joins; stored all in one file; the db and sql
monitor can easily fit on a removable drive... I suppose there's more.
-Ross.
Hickey,Thom wrote:
>I believe that MySQL 4.1 supports nested queries and is now out of beta.
>
>--Th
>
>
>-----Original Message-----
>From: Code for Libraries [mailto:[log in to unmask]] On Behalf Of
>Andrew Nagy
>Sent: Monday, November 29, 2004 5:20 PM
>To: [log in to unmask]
>Subject: Re: [CODE4LIB] SQL question
>
>Andrew Darby wrote:
>
>
>
>>Is there a way, in the SQL, to generate my "mama bear" set: i.e., with
>>the subjects grouped together like so:
>>
>>Smith, Joe | English, History, Italian | 425-5000 | [log in to unmask]
>>Turner, Ted | Math, Politics, Zoology | 425-5111 | [log in to unmask]
>>
>>Or do I have to run another query inside the php loop? (I seem to
>>remember, from a previous life, that you could do these "queries
>>
>>
>within
>
>
>>queries" in ColdFusion.)
>>
>>
>
>Andrew, you cannot do this with MySQL. MySQL does not support nested
>queries nor union clauses. You could attempt this with Postgres, but
>you still wouldn't be able to have multiple columns from one table all
>in one column in a result from another table. The best way to do this
>is to use 2 queries if you are using MySQL. If you want to use postgres
>you could do this with a stored procedure or a really advanced nested
>query but then the nested query would probably run slower than 2 simple
>queries. :)
>
>Good luck
>Andrew
>
>
>
|