Hi Emir,

I have to withdraw the withdrawal of the post below, again this time because 
the cascaded "select" works only in one version of my installed mysqls. The 
most curious thing is that it worked with version 3.8+ but not with 4.0 ???

So I rewrote the query to single select with join. Here is it:

$sqldep="SELECT d.id  AS did,  
d.name_short  AS  dname,   
d.LD_var as \"LD_var\",   
w.dept_nr AS dept_nr 
FROM care_ward AS w  
LEFT   JOIN care_department AS d ON d.nr = w.dept_nr   
WHERE w.is_temp_closed=0 
GROUP BY w.dept_nr,d.id,d.name_short,d.LD_var 
ORDER by w.dept_nr ";

Now it works for both versions.  

For those interested to see how Emir's code improves the menu tree, you can 
see the demo here: http://www.care2x.org/foundry/ . Use the drop-down tree 
menu style and expand the "Nursing" item.

Thanks,
Elpidio

On Wednesday 08 December 2004 22:04, Elpidio Latorilla wrote:
> Hi,
>
> ehem, I have to withdraw the post below :)  The sql query is ok. it works
> in my local installation. the problem was caused by some typo bugs. I will
> report on it later.
>
> Nice work Emir !!!!
>
> Elpidio
>
> On Wednesday 08 December 2004 21:58, Elpidio Latorilla wrote:
> > Hi Emir,
> >
> > it looks like you are using the mysql 4.1 version because of your use of
> > cascaded "select" in your query. Earlier versions of mysql do not support
> > this.  I cannot run the script because of my older mysql version.
> >
> > Well, looking at the query, it looks like it can be rewritten to one
> > using only normal joins.
> >
> > Let me see....
> >
> > Elpidio



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Care2002-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/care2002-developers

Reply via email to