0
有什么建议吗?任何人都解决过这个问题?如何将使用多个连接和子查询的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 2012-02-23 18:44:33