I did something similar to what steve said, and I basically put all the
data in one merged table and did the following mysql query on it

SELECT V, U, H, MIN(cast(P as decimal)) AS L_SALARY, MAX(cast(P as
decimal)) AS U_SALARY, SUM(T) AS W_COUNT, COUNT(U) AS H_COUNT FROM
`wp_lca_2013` where left(m,7) = " . "'" . $get_code . "'" . " AND left(V,2)
= " . "'" . $get_cstate . "'" . " GROUP BY U order by count(U) DESC

Worked good for me on this project.


On Wed, Oct 29, 2014 at 8:50 AM, Bill Anderson <billan...@gmail.com> wrote:

> Jean,
>
> I think issue is a flaw in the JOIN. I don't see how ta ties to the rest of
> the join.
>
> FROM cantine_services sv ;
>         INNER JOIN cantine_salles sal ON sv.salle = sal.clef, ;
>          tarifs_cantine ta ;
>        WHERE ta.anscol = lcannee INTO CURSOR
>
> I don't see how tarif_cantine (ta) ties to the other tables unless this is
> a shorthand that I'm unaware of.
>
> I'd expect the join to look something like this:
>
> ...FROM cantine_services sv ;
>         INNER JOIN cantine_salles sal ON sv.salle = sal.clef ;
>         INNER JOIN  tarifs_cantine ta ON (< however the tables tie together
> >);
>        WHERE ta.anscol = lcannee INTO CURSOR...
>
> Also, the comma after sal.clef doesn't belong there.
>
> Bill Anderson
>
>
> On Wed, Oct 29, 2014 at 3:39 AM, Jean MAURICE <jsm.maur...@wanadoo.fr>
> wrote:
>
> > Hi Bill : unknown alias ta !
> >
> > The Foxil
> >
> > Le 28/10/2014 22:08, Bill Anderson a écrit :
> >
> >> Jean,
> >>
> >> That should fail. The column names would not be available to be used in
> >> the
> >> SELECT portion of the clause. If you use the HAVING clause as part of
> the
> >> join, the column names are available to be used.
> >>
> >> Replace the Disponible field with this and see if it works:
> >>
> >> CAST(EVALUATE("MIN(sal.capacite, sv.capacite, ta.capacite, ta.maxjour)")
> >> AS
> >> Integer) AS disponible
> >>
> >> Bill Anderson
> >>
> >>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/CAPuy6VPabi=jFzgKaVr8vZxrFguzVo=axYXTb6sRcoyWvgWx=q...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to