아이디어가 있으십니까? 누구든지이 문제를 해결하기 전에? 사전에다중 조인과 서브 쿼리를 사용하여이 SQL 쿼리를 Perl DBIx :: Class로 변환하려면 어떻게해야합니까?
select c.parent_id, c.category_id, c.name, count(*) from categories c join product_categories pc on c.category_id = pc.category_id join authorizations a on pc.product_id = a.product_id join set_authorizations sa on a.authorization_id = sa.authorization_id where a.active = 1 and sa.set_id = 2 and c.parent_id in ( select category_id from categories where parent_id is null ) group by c.parent_id, c.category_id, c.name;
감사합니다 ...
테이블과 외래 키에 대한 DBIx :: Class 정의가 이미 있습니까? – dgw