select h.name as PSC ,count(DISTINCT c.id) as Papers,avg
(c.duration),count(DISTINCT c.duration >= 155),count(DISTINCT 155 <=
c.duration)
from
contracts as c
inner join
holders as h on h.id = c.holder_id
where
c.status = 1
and
c.waiver =0
and
c.commitee_id !=6
group by
h.name

using the above query i manage to get it done half way.however the
last 2 column still have problem as i still finding way to count
duration less than 155 and more than 155



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to