I have the following query:
$queryResult = $this->Hit->query(
"select P, count(S) as S
from
(
select pattern_id as P, srn as S from hits
where job_id=".$id." and srn != ''
group by srn, pattern_id
order by pattern_id, srn
) as T
group by P
order by P;"
);
So basically I have a select .. from (select .. ) ...
statement.
It's working perfect while I'm using MySQL. But I have to migrate the DB to PostgreSQL so I would like to change this to the Cake-way. So my question is, how can I interpret this type of query (select from select
) in CakePHP?
Thanks in advance.